зеркало из https://github.com/mozilla/gecko-dev.git
Bug 365329: string to date conversion returns wrong value for dates in february when run after 28th of each month, patch by Magnus Melin <mkmelin+mozilla@iki.fi>, r=neil, sr=mscott
This commit is contained in:
Родитель
85ef838c47
Коммит
98fbee70ff
|
@ -248,14 +248,7 @@ function convertStringToPRTime(str)
|
|||
|
||||
month -= 1; // since js month is 0-11
|
||||
|
||||
var time = new Date();
|
||||
time.setMilliseconds(0);
|
||||
time.setSeconds(0);
|
||||
time.setMinutes(0);
|
||||
time.setHours(0);
|
||||
time.setYear(year);
|
||||
time.setMonth(month);
|
||||
time.setDate(date);
|
||||
var time = new Date(year, month, date);
|
||||
|
||||
// JavaScript time is in milliseconds, PRTime is in microseconds
|
||||
// so multiply by 1000 when converting
|
||||
|
|
Загрузка…
Ссылка в новой задаче