Format topic set date

This commit is contained in:
Pavel Djundik 2016-03-20 19:18:43 +02:00 committed by Maxime Poulin
parent 92cc130e2b
commit 43f58a8075
3 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1,7 @@
Handlebars.registerHelper(
"localeDate", function(date) {
date = new Date(date);
return date.toLocaleString();
}
);

View File

@ -1 +1 @@
Topic set by {{nick}} on {{when}}
Topic set by {{nick}} on {{localeDate when}}

View File

@ -39,7 +39,7 @@ module.exports = function(irc, network) {
type: Msg.Type.TOPIC_SET_BY,
mode: chan.getMode(data.nick),
nick: data.nick,
when: data.when,
when: new Date(data.when * 1000),
self: data.nick === irc.user.nick
});
chan.messages.push(msg);