Skip to content

Commit

Permalink
Merge pull request #183 from thelounge/xpaw/time-machine
Browse files Browse the repository at this point in the history
Remove moment.js from the client
  • Loading branch information
maxpoulin64 committed Mar 11, 2016
2 parents 5aff925 + d7750db commit 0696a47
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2,617 deletions.
17 changes: 12 additions & 5 deletions client/js/libs/handlebars/tz.js
@@ -1,10 +1,17 @@
Handlebars.registerHelper(
"tz", function(time) {
if (time) {
var utc = moment.utc(time, "HH:mm:ss").toDate();
return moment(utc).format("HH:mm");
} else {
return "";
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;
}
);

0 comments on commit 0696a47

Please sign in to comment.