Commit 95d53737 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

fix: Bug 18566 - Некорректный результат вычисления вложенных функций категории Date Time

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50270 954022d7-b5bf-4e40-9824-e11837661b57
parent 10c168e0
......@@ -630,10 +630,10 @@ cFormulaFunction.DateAndTime = {
if(val < 0)
return this.setCA( new cError( cErrorType.not_numeric ) ,true);
if(!g_bDate1904){
if( val == 60 )
return this.setCA( new cNumber( 2 ) ,true,0);
if ( val == 60 )
return this.setCA( new cNumber( 2 ), true, 0 );
else
return this.setCA( new cNumber( ( new Date( ( (val==0?1:val) - c_DateCorrectConst ) * c_msPerDay) ).getUTCMonth() + 1 ) ,true,0);
return this.setCA( new cNumber( ( new Date( ( (val == 0 ? 1 : val) - c_DateCorrectConst - 1 ) * c_msPerDay ) ).getUTCMonth() + 1 ), true, 0 );
}
else
return this.setCA( new cNumber( ( new Date( ( (val==0?1:val) - c_DateCorrectConst ) * c_msPerDay) ).getUTCMonth() + 1 ) ,true,0);
......
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