jubayerarefin / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

Bug: goog.date.Date and DST #599

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

What steps will reproduce the problem?
1. Set the computer date to 2013-10-20 and Time Zone to "Brasilia Summer Time" 
(City: São Paulo - Brazil)
2. When creating a Date instance, the browser's console should output something 
like:
    > new Date 
    Sun Oct 20 2013 19:50:18 GMT-0200 (BRST)
3. With Closure Library loaded, create a new instance of goog.date.Date:
    > date = new goog.date.Date()
    > date.getDate()
    19

What is the expected output? What do you see instead?

date.getDate() should return 20. Instead 19 is returned.

What version of the product are you using? On what operating system?

Chrome, OS X.

Please provide any additional information below.

Internally, goog.date.Date calls setHours(0) on the internal Date object. Since 
there is no hour 0 on Oct 20 for this timezone, the day goes back to 19.

Original issue reported on code.google.com by alo.and on 21 Oct 2013 at 10:01

GoogleCodeExporter commented 8 years ago
Corresponding Chrome bug: http://crbug.com/341874

Original comment by pall...@google.com on 2 Apr 2014 at 9:08

GoogleCodeExporter commented 8 years ago
Moved to https://github.com/google/closure-library/issues/34 with a fix pending

Original comment by joelt...@google.com on 23 Jul 2015 at 5:23