Commit 28c6e7e5 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

ошибка при распознавании даты 3-1-1900, не распознавалась дата 2-29-1900.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56348 954022d7-b5bf-4e40-9824-e11837661b57
parent 1a0fc459
...@@ -3415,9 +3415,9 @@ FormatParser.prototype = ...@@ -3415,9 +3415,9 @@ FormatParser.prototype =
dValue = (Date.UTC(nYear,nMounth,nDay,nHour,nMinute,nSecond) - Date.UTC(1904,0,1,0,0,0)) / (86400 * 1000); dValue = (Date.UTC(nYear,nMounth,nDay,nHour,nMinute,nSecond) - Date.UTC(1904,0,1,0,0,0)) / (86400 * 1000);
else else
{ {
if(1900 < nYear || (1900 == nYear && 2 < nMounth )) if(1900 < nYear || (1900 == nYear && 1 < nMounth ))
dValue = (Date.UTC(nYear,nMounth,nDay,nHour,nMinute,nSecond) - Date.UTC(1899,11,30,0,0,0)) / (86400 * 1000); dValue = (Date.UTC(nYear,nMounth,nDay,nHour,nMinute,nSecond) - Date.UTC(1899,11,30,0,0,0)) / (86400 * 1000);
else if(1900 == nYear && 2 == nMounth && 29 == nDay) else if(1900 == nYear && 1 == nMounth && 29 == nDay)
dValue = 60; dValue = 60;
else else
dValue = (Date.UTC(nYear,nMounth,nDay,nHour,nMinute,nSecond) - Date.UTC(1899,11,31,0,0,0)) / (86400 * 1000); dValue = (Date.UTC(nYear,nMounth,nDay,nHour,nMinute,nSecond) - Date.UTC(1899,11,31,0,0,0)) / (86400 * 1000);
...@@ -3457,10 +3457,12 @@ FormatParser.prototype = ...@@ -3457,10 +3457,12 @@ FormatParser.prototype =
{ {
if(nMounth < 0 || nMounth > 11) if(nMounth < 0 || nMounth > 11)
return false; return false;
else else if(this.isValidDay(nYear, nMounth, nDay))
return this.isValidDay(nYear, nMounth, nDay); return true;
} else if(1900 == nYear && 1 == nMounth && 29 == nDay)
return true; return true;
}
return false;
}, },
isValidDay : function(nYear, nMounth, nDay){ isValidDay : function(nYear, nMounth, nDay){
if(this.isLeapYear(nYear)) if(this.isLeapYear(nYear))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment