Author: ygrego Date: 2015-06-22 09:50:14 +0000 (Mon, 22 Jun 2015) New Revision: 1757 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1757 Log: The value returned by these methods must be of type Integer. Modified: oipf/lib/js/utils/DateUtils.js Modified: oipf/lib/js/utils/DateUtils.js =================================================================== --- oipf/lib/js/utils/DateUtils.js 2015-06-22 09:45:13 UTC (rev 1756) +++ oipf/lib/js/utils/DateUtils.js 2015-06-22 09:50:14 UTC (rev 1757) @@ -14,7 +14,7 @@ } millisecondsToSeconds(timeInMilliseconds) { - return timeInMilliseconds / 1000; + return this.round(timeInMilliseconds / 1000); } nowInSeconds() { @@ -22,15 +22,19 @@ } secondsToMilliseconds(timeInSeconds) { - return timeInSeconds * 1000; + return this.round(timeInSeconds * 1000); } secondsToMinutes(timeInSeconds) { - return timeInSeconds / 60; + return this.round(timeInSeconds / 60); } yesterday() { return this._yesterday; } + round(time) { + return Math.round(time); + } + }
participants (1)
-
ygregoï¼ users.nuiton.org