diff --git a/client/js/libs/handlebars/date.js b/client/js/libs/handlebars/date.js new file mode 100644 index 00000000..751e713d --- /dev/null +++ b/client/js/libs/handlebars/date.js @@ -0,0 +1,7 @@ +Handlebars.registerHelper( + "localeDate", function(date) { + date = new Date(date); + + return date.toLocaleString(); + } +); diff --git a/client/views/actions/topic_set_by.tpl b/client/views/actions/topic_set_by.tpl index 87d8ee83..d842fa67 100644 --- a/client/views/actions/topic_set_by.tpl +++ b/client/views/actions/topic_set_by.tpl @@ -1 +1 @@ -Topic set by {{nick}} on {{when}} +Topic set by {{nick}} on {{localeDate when}} diff --git a/src/plugins/irc-events/topic.js b/src/plugins/irc-events/topic.js index be63c451..f341fcd7 100644 --- a/src/plugins/irc-events/topic.js +++ b/src/plugins/irc-events/topic.js @@ -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);