Broken in Firefox 3.6 #45

Closed
tadfisher opened this Issue Oct 9, 2012 · 7 comments

Projects

None yet

3 participants

@tadfisher

Minimal test-case:

var dt = new timezoneJS.Date(2012, 9, 8, 0, 0, 0, "Pacific/Honolulu");
dt.toJSON();

>>> Error: Units must be a number.

Not sure what's causing this only in Firefox 3.6; it looks like timezone.getTzInfo isn't set at the time toString() is called. IE, newer Firefoxes, and Chrome works fine.

@tadfisher

Here's something that is odd.

Running this code repeatedly has varying results:

>>> new timezoneJS.Date(1349690400000, "Pacific/Honolulu");
2012-10-08 00:00:00 { _useCache=true, _tzInfo={...}, more...}
>>> new timezoneJS.Date(1349690400000, "Pacific/Honolulu");
0NaN-NaN-NaN NaN:NaN:NaN { _useCache=true, _tzInfo={...}, more...}
>>> new timezoneJS.Date(1349690400000, "Pacific/Honolulu");
2012-10-08 00:00:00 { _useCache=true, _tzInfo={...}, more...}
>>> new timezoneJS.Date(1349690400000, "Pacific/Honolulu");
0NaN-NaN-NaN NaN:NaN:NaN { _useCache=true, _tzInfo={...}, more...}
>>> new timezoneJS.Date(1349690400000, "Pacific/Honolulu");
2012-10-08 00:00:00 { _useCache=true, _tzInfo={...}, more...}
@longlho
Collaborator
longlho commented Oct 9, 2012

hmm that's weird indeed. Can you specify which browser/OS? I'll take a look

@tadfisher

Firefox 3.6, Windows 7 (also tested on XP, same issues)

@longlho
Collaborator
longlho commented Oct 9, 2012

Cool I'll try to repl and fix it

@satyrad
satyrad commented Oct 19, 2012

Same problem, Firefox 3.x. Tested several versions between 3.0 and 3.5. Tested on Windows 7 and Linux. Trying to find my way around right now, but can't find it so far. Very annoying issue that unfortunately did not occur in modern browsers, therefore now the changes are live on my site and suddenly all customers with FF 3.x are complaining! ;)

@longlho
Collaborator
longlho commented Oct 19, 2012

Should be fixed now so guys, try it out. Sry I couldn't find time till now.

@satyrad
satyrad commented Oct 19, 2012

Will try immediately. Thanks a lot!

Edit: Great, I tested it and it seems to work like a charm! Awesome and thanks a lot!

@longlho longlho closed this Oct 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment