meh, JS Date support is so annoyingly bad
This commit is contained in:
@ -81,7 +81,9 @@ window.unixTimeToString = function(time, full) {
|
||||
window.unixTimeToHHmm = function(time) {
|
||||
if(!time) return null;
|
||||
var d = new Date(typeof time === 'string' ? parseInt(time) : time);
|
||||
return d.getHours() + ':' + d.getSeconds();
|
||||
var h = '' + d.getHours(); h = h.length === 1 ? '0' + h : h;
|
||||
var s = '' + d.getSeconds(); s = s.length === 1 ? '0' + s : s;
|
||||
return h + ':' + s;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user