angular/angular.js — pull request #6256 by gregkowalski (2014-02-14 07:07:07+00:00)
Title: test(date): fix failing test when running in Seoul, Korea time zone (UTC...

...+09:00)

This is a minor fix to a unit test assertion that fails when running in the Seoul time zone (UTC+09:00):

expect(date('2003-09-10T13:02:03.12345678Z', format)).toEqual('2003-09-10');

Underneath, the JavaScript setUTCHours() function is called and when the millisecond part is larger than 999, it just adds seconds, minutes, or hours to the date. For example, passing milliseconds of 70500 to this function will actually add 1 minute, 10 seconds, 500 milliseconds. So adding 12345678 milliseconds, combined with the +09:00 time zone, adds enough hours to shift the day to 11, thus causing the test to fail. This fix simply changes the milliseconds part to 00000001, which still tests the string parsing and date formatting without changing the date to the next day.