There is a strange behavior of the dateFinFlow method 34 setMinutes for setting 60 minutes for 2008 January 01 23 hours 00 minutes 00 seconds. This is expected to increase the day, but it is not.
var initDate = [2008, 0, 1]; var d = new Date(initDate[0], initDate[1], initDate[2]); document.body.innerHTML += d + "<br/>"; d.setHours(23); d.setMinutes(60); document.body.innerHTML += d + "<br/>";
Result of FireFox 34:
Tue Jan 01 2008 00:00:00 GMT+0300 (Russia TZ 2 Standard Time) Tue Jan 01 2008 23:00:00 GMT+0300 (Russia TZ 2 Standard Time)
instead of Chrome 39.0.2171.71 m:
Tue Jan 01 2008 00:00:00 GMT+0300 (Russia TZ 2 Standard Time) Wed Jan 02 2008 01:00:00 GMT+0400 (Russia TZ 2 Daylight Time)
If I change the year to 2006, the result will be agreed:
Sun Jan 01 2006 00:00:00 GMT+0300 (Russia TZ 2 Standard Time) Mon Jan 02 2006 00:00:00 GMT+0300 (Russia TZ 2 Standard Time)
http://jsfiddle.net/7dp8xvf8/1/
This is mistake?
UPDATE: IE 8 and 9 have the same behavior, but 10-11 are fine.
javascript date firefox time
Dmitry Shost
source share