From: Alan Knowles Date: Wed, 9 Mar 2022 02:11:09 +0000 (+0800) Subject: fix simple interval support to Date.getElapsed() X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=69f336985f0422644ff6bc9d35327e8a2640941c fix simple interval support to Date.getElapsed() --- diff --git a/Date.js b/Date.js index dab725c026..0470095f7f 100644 --- a/Date.js +++ b/Date.js @@ -117,11 +117,11 @@ Date.prototype.getElapsed = function(date, interval) case Date.SECOND: return Math.floor(ret / (1000)); case Date.MINUTE: - return Math.floor(ret / (100*60)); + return Math.floor(ret / (1000*60)); case Date.HOUR: - return Math.floor(ret / (100*60*60)); + return Math.floor(ret / (1000*60*60)); case Date.DAY: - return Math.floor(ret / (100*60*60*24)); + return Math.floor(ret / (1000*60*60*24)); case Date.MONTH: // this does not give exact number...?? return ((date.format("Y") - this.format("Y")) * 12) + (date.format("m") - this.format("m")); case Date.YEAR: // this does not give exact number...?? diff --git a/docs/src/Date.js.html b/docs/src/Date.js.html index 768075bcbb..fedb80ca11 100644 --- a/docs/src/Date.js.html +++ b/docs/src/Date.js.html @@ -117,11 +117,11 @@ document.write(dt.format(Date.patterns.ShortDate)); case Date.SECOND: return Math.floor(ret / (1000)); case Date.MINUTE: - return Math.floor(ret / (100*60)); + return Math.floor(ret / (1000*60)); case Date.HOUR: - return Math.floor(ret / (100*60*60)); + return Math.floor(ret / (1000*60*60)); case Date.DAY: - return Math.floor(ret / (100*60*60*24)); + return Math.floor(ret / (1000*60*60*24)); case Date.MONTH: // this does not give exact number...?? return ((date.format("Y") - this.format("Y")) * 12) + (date.format("m") - this.format("m")); case Date.YEAR: // this does not give exact number...?? diff --git a/roojs-all.js b/roojs-all.js index 2f9683656a..1b2f8c7541 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -37,7 +37,7 @@ Roo.applyIf(Array.prototype,{indexOf:function(o){for(var i=0,A=this.length;i