| Issue 923: | parseISO8601 not parsing dates correctly in FF 4. | |
| 2 people starred this issue and may be notified of changes. | Back to list |
From firebug in FF 4:
>>> jQuery.fullCalendar.parseISO8601("2011-04-18T17:00:00Z").getUTCHours()
22
Shouldn't the result be 17?
parseISO8601 returns this date object:
>>> jQuery.fullCalendar.parseISO8601("2011-04-18T17:00:00Z")
Date {Mon Apr 18 2011 17:00:00 GMT-0500 (CDT)}
I think the date object should be "12:00:00 GMT-0500" to be the same time. Am I misunderstanding it?
From FF 4's Date object:
>>> new Date("2011-04-18T17:00:00Z")
Date {Mon Apr 18 2011 12:00:00 GMT-0500 (CDT)}
>>> new Date("2011-04-18T17:00:00Z").getUTCHours()
17
This may be related to bug 918 .
Apr 20, 2011
Hi, this is my workaround. If I'm missing something, I'd be excited to know more.
function parseISO8601(s, ignoreTimezone) { // ignoreTimezone defaults to false
// if browser Date can parse s, and get a timestamp, then use browser parser.
if (!isNaN(Date.parse(s))) {
return new Date(s); // does not use ignoreTimezone
}
...
}
May 8, 2011
(No comment was entered for this change.)
Status:
Duplicate
Mergedinto: 750 |
|
| ► Sign in to add a comment |
>>> jQuery.fullCalendar.parseISO8601("2011-04-18T17:00:00Z", false).getUTCHours() 22 >>> jQuery.fullCalendar.parseISO8601("2011-04-18T17:00:00Z", true).getUTCHours() 22