Remove moment.js from the client

This commit is contained in:
Pavel Djundik 2016-03-11 22:14:15 +02:00
parent 5aff925aa5
commit d7750db87f
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));