Merge pull request #183 from thelounge/xpaw/time-machine
Remove moment.js from the client
This commit is contained in:
commit
0696a472a8
@ -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
@ -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));
|
||||||
|
Loading…
Reference in New Issue
Block a user