Menu
Welcome, Guest
Username: Password: Secret Key Remember me
Welcome to the Developer forum!
Get all your questions answered here. Learn to integrate calendar in your application.
  • Page:
  • 1

TOPIC: Funny date problem

Funny date problem 14 years 6 months ago #249

  • nicoos
  • nicoos's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
When ading a new event, in function getDateFromStrings(dateString, timeString) I am experiencing a problem where by the incorrect date is returned

function getDateFromStrings(dateString, timeString)
{
alert("gdfs1: "+dateString)
var dt = (timeString == "") ? new Date() : parseTime(timeString);
var tempDate = UTC.parseDateString(dateString);
alert("gdfs2: "+tempDate)

dt.setMonth(tempDate.getMonth());
dt.setYear(tempDate.getYear());
dt.setDate(tempDate.getDate());
return dt;
}

The first alert display the correct date: "4/1/2010".The second alert displai "1 May 2010"

This is only true for April. March dates are added fine, and sou are May...all April date get returned as May...

Please help/advise..

Version 1.2.9
Nic Oosthuizen

Please Log in to join the conversation.

Last edit: by nicoos.

Re:Funny date problem 14 years 6 months ago #250

  • ragskarnam
  • ragskarnam's Avatar
  • Visitor
  • Visitor
I use the premium version and I don't see this issue. But my suggestion is don't rely on utc code of web2cal and instead try using datejs or any other external library to do your parsing. Even better, simply create new date(year, m,d, and so on)

try datejs.com that has some useful parsing functionality.

Rags

Please Log in to join the conversation.

  • Page:
  • 1
Time to create page: 0.053 seconds
Powered by Kunena Forum

LATEST IN FORUM

  • No posts to display.

ABOUT US