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:
gavin%gavinsharp.com 2007-01-04 19:48:04 +00:00
Родитель 85ef838c47
Коммит 98fbee70ff
1 изменённых файлов: 1 добавлений и 8 удалений

Просмотреть файл

@ -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