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(
|
||||
"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
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user