Merge pull request #183 from thelounge/xpaw/time-machine

Remove moment.js from the client
This commit is contained in:
Max-P 2016-03-11 17:45:18 -05:00
commit 0696a472a8
3 changed files with 13 additions and 2617 deletions

View File

@ -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;
}
);

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,4 @@
var _ = require("lodash");
var moment = require("moment");
Msg.Type = {
ACTION: "action",
@ -28,7 +27,7 @@ function Msg(attr) {
from: "",
id: id++,
text: "",
time: moment().utc().format("HH:mm:ss"),
time: new Date(),
type: Msg.Type.MESSAGE,
self: false
}, attr));