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( Handlebars.registerHelper(
"tz", function(time) { "tz", function(time) {
if (time) { time = new Date(time);
var utc = moment.utc(time, "HH:mm:ss").toDate(); var h = time.getHours();
return moment(utc).format("HH:mm"); var m = time.getMinutes();
} else {
return ""; 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 _ = require("lodash");
var moment = require("moment");
Msg.Type = { Msg.Type = {
ACTION: "action", ACTION: "action",
@ -28,7 +27,7 @@ function Msg(attr) {
from: "", from: "",
id: id++, id: id++,
text: "", text: "",
time: moment().utc().format("HH:mm:ss"), time: new Date(),
type: Msg.Type.MESSAGE, type: Msg.Type.MESSAGE,
self: false self: false
}, attr)); }, attr));