mirror of
https://github.com/thelounge/thelounge
synced 2024-11-27 06:20:26 +00:00
Format topic set date
This commit is contained in:
parent
92cc130e2b
commit
43f58a8075
3 changed files with 9 additions and 2 deletions
7
client/js/libs/handlebars/date.js
Normal file
7
client/js/libs/handlebars/date.js
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Handlebars.registerHelper(
|
||||||
|
"localeDate", function(date) {
|
||||||
|
date = new Date(date);
|
||||||
|
|
||||||
|
return date.toLocaleString();
|
||||||
|
}
|
||||||
|
);
|
|
@ -1 +1 @@
|
||||||
Topic set by {{nick}} on {{when}}
|
Topic set by {{nick}} on {{localeDate when}}
|
||||||
|
|
|
@ -39,7 +39,7 @@ module.exports = function(irc, network) {
|
||||||
type: Msg.Type.TOPIC_SET_BY,
|
type: Msg.Type.TOPIC_SET_BY,
|
||||||
mode: chan.getMode(data.nick),
|
mode: chan.getMode(data.nick),
|
||||||
nick: data.nick,
|
nick: data.nick,
|
||||||
when: data.when,
|
when: new Date(data.when * 1000),
|
||||||
self: data.nick === irc.user.nick
|
self: data.nick === irc.user.nick
|
||||||
});
|
});
|
||||||
chan.messages.push(msg);
|
chan.messages.push(msg);
|
||||||
|
|
Loading…
Reference in a new issue