My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 923: parseISO8601 not parsing dates correctly in FF 4.
2 people starred this issue and may be notified of changes. Back to list
Status:  Duplicate
Merged:  issue 750
Owner:  ----
Closed:  May 2011


Sign in to add a comment
 
Reported by michaelc...@michaelcole.com, Apr 20, 2011
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
#1 michaelc...@michaelcole.com
>>> jQuery.fullCalendar.parseISO8601("2011-04-18T17:00:00Z", false).getUTCHours()
22
>>> jQuery.fullCalendar.parseISO8601("2011-04-18T17:00:00Z", true).getUTCHours()
22
Apr 20, 2011
#2 michaelc...@michaelcole.com
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
Project Member #3 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Duplicate
Mergedinto: 750
Sign in to add a comment

Powered by Google Project Hosting