Commit 97cfb78b authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix TIMEVALUE function calculate

parent c1bc97fd
...@@ -1383,22 +1383,19 @@ cTIMEVALUE.prototype.Calculate = function ( arg ) { ...@@ -1383,22 +1383,19 @@ cTIMEVALUE.prototype.Calculate = function ( arg ) {
if ( arg0 instanceof cError ) if ( arg0 instanceof cError )
return this.value = arg0; return this.value = arg0;
if ( arg0.tocNumber() instanceof cNumber && arg0.tocNumber().getValue() > 0 )
return this.value = new cNumber( parseInt( arg0.tocNumber().getValue() ) );
var res = g_oFormatParser.parse( arg0.getValue() ); var res = g_oFormatParser.parse( arg0.getValue() );
if ( res && res.bDateTime ) if ( res && res.bDateTime )
return this.value = new cNumber( res.value - parseInt( res.value ) ); return this.value = new cNumber( res.value - parseInt( res.value ) );
else else
return this.value = new cError( cErrorType.wrong_value_type ); return this.value = new cError( cErrorType.wrong_value_type );
} };
cTIMEVALUE.prototype.getInfo = function () { cTIMEVALUE.prototype.getInfo = function () {
return { return {
name:this.name, name:this.name,
args:"( date-time-string )" args:"( date-time-string )"
}; };
} };
function cTODAY() { function cTODAY() {
// cBaseFunction.call( this, "TODAY", 0, 0 ); // cBaseFunction.call( this, "TODAY", 0, 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