JosephMajaseSithole / datejs

Automatically exported from code.google.com/p/datejs
0 stars 0 forks source link

Date.parse() works differently on different browsers #40

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open your homepage in IE7 and Firefox2 on a thur, fri or sat
2. Type 'wednesday' in Mad Skillz.. demo box
3. IE7 shows May 14, Firefox show May 7.

Same issue for 'today', 'sun.. sat', 'last ...', etc.

Safari works like Firefox. I don't know about IE6 yet.

What is the expected output? What do you see instead?
The same date on all browsers. Different dates depending on the browser.

What version of the product are you using? On what operating system?
 * Version: 1.0 Alpha-1 
 * Build Date: 13-Nov-2007

Original issue reported on code.google.com by brady.da...@gmail.com on 11 May 2008 at 2:58

GoogleCodeExporter commented 8 years ago
Are you getting these results on the datejs.com homepage right now? If yes, 
maybe
check again in a few hours. The build date of the date.js file on the homepage 
is
2008-04-13. At the moment "wednesday" returns the correct result for me across 
FF,
IE7/8, Safari & Opera.

This is a pretty strange result to get. Results like this might be possible if 
the
browsers have different internal clock settings. The firstDayOfWeek setting is 
for
Sunday (at this moment it's late Saturday PM). If one browser clock/time was in
Saturday, and another in Sunday, then you would get those results. 

Everything in the Parser is based on the internal clock of the browser. If that 
is
wrong, then you might/will get unexpected results. There's nothing particularly
browser dependent with datejs. Just JavaScript dependent. 

Original comment by geoff%co...@gtempaccount.com on 11 May 2008 at 3:13

GoogleCodeExporter commented 8 years ago
Oooh, Sorry about that... this bug is an error. 

I'm running IE7 in a VM and didn't notice the time was off by a few hours. But 
since
it happens to be late on a Saturday it triggered the end of the week cutoff so
everything was off by a week. 

After setting the correct time, Date.parse() works as expected. Thanks for the 
great
software!

Original comment by brady.da...@gmail.com on 11 May 2008 at 3:51

GoogleCodeExporter commented 8 years ago
Oh, I just noticed that the one on the date.js home page works as expected. The 
date of that build (2008-05-13) is newer than the one available for download 
(2007-11-13), although the version numbers match. Maybe the download link on 
the home page should be updated. Easiest bug fix ever. :)

Original comment by rmannin...@gmail.com on 1 Dec 2012 at 8:25