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

getExcelDateWithTime

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62397 954022d7-b5bf-4e40-9824-e11837661b57
parent 5545b64e
...@@ -68,6 +68,10 @@ Date.prototype.truncate = function () { ...@@ -68,6 +68,10 @@ Date.prototype.truncate = function () {
}; };
Date.prototype.getExcelDate = function () { Date.prototype.getExcelDate = function () {
return Math.floor(this.getExcelDateWithTime());
};
Date.prototype.getExcelDateWithTime = function () {
// return Math.floor( ( this.getTime() / 1000 - this.getTimezoneOffset() * 60 ) / c_sPerDay + ( c_DateCorrectConst + (g_bDate1904 ? 0 : 1) ) ); // return Math.floor( ( this.getTime() / 1000 - this.getTimezoneOffset() * 60 ) / c_sPerDay + ( c_DateCorrectConst + (g_bDate1904 ? 0 : 1) ) );
var year = this.getUTCFullYear(), month = this.getUTCMonth(), date = this.getUTCDate(), res; var year = this.getUTCFullYear(), month = this.getUTCMonth(), date = this.getUTCDate(), res;
...@@ -78,7 +82,7 @@ Date.prototype.getExcelDate = function () { ...@@ -78,7 +82,7 @@ Date.prototype.getExcelDate = function () {
else else
res = (Date.UTC(year, month, date, this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()) - this.getExcelNullDate() ) / c_msPerDay - 1; res = (Date.UTC(year, month, date, this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()) - this.getExcelNullDate() ) / c_msPerDay - 1;
return Math.floor(res); return res;
}; };
Date.prototype.getDateFromExcel = function ( val ) { Date.prototype.getDateFromExcel = function ( val ) {
......
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