Changeset 12515 for branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3/WebApp/helper.js
- Timestamp:
- 06/25/15 18:21:19 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3/WebApp/helper.js
r12428 r12515 7 7 Number.prototype.zeropad = function (n) { 8 8 return (new Array(n + 1).join("0") + this).slice(-n); 9 }; 10 11 Number.prototype.toHHMMSS = function() { 12 d = this; 13 d = Number(d); 14 var years = Math.floor(d / 31536000); 15 var days = Math.floor(d / 86400 % 365); 16 var h = Math.floor(d / 3600 % 24); 17 var m = Math.floor(d % 3600 / 60); 18 var s = Math.floor(d % 3600 % 60); 19 var timeStr = ""; 20 if (years > 0) { 21 timeStr = years + "y "; 22 } 23 if (days > 0) { 24 timeStr = timeStr + days + "d "; 25 } 26 return timeStr + h.zeropad(2) + ":" + m.zeropad(2) + ":" + s.zeropad(2); 9 27 }; 10 28 … … 44 62 return day + '.' + month + '.' + year + ' ' + hour + ':' + minute + ':' + second; 45 63 }; 64
Note: See TracChangeset
for help on using the changeset viewer.