thelounge/client/js/libs/handlebars/tz.js

18 lines
220 B
JavaScript
Raw Normal View History

"use strict";
2016-12-18 15:53:28 +00:00
module.exports = function(time) {
time = new Date(time);
var h = time.getHours();
var m = time.getMinutes();
2016-12-18 15:53:28 +00:00
if (h < 10) {
h = "0" + h;
}
2016-03-11 20:14:15 +00:00
2016-12-18 15:53:28 +00:00
if (m < 10) {
m = "0" + m;
2014-07-24 00:16:00 +00:00
}
2016-12-18 15:53:28 +00:00
return h + ":" + m;
};