thelounge/client/js/libs/handlebars/tz.js
2017-03-18 11:21:18 +02:00

17 lines
220 B
JavaScript

"use strict";
module.exports = function(time) {
time = new Date(time);
var h = time.getHours();
var m = time.getMinutes();
if (h < 10) {
h = "0" + h;
}
if (m < 10) {
m = "0" + m;
}
return h + ":" + m;
};