Commit 57e457da58370df9009c5dc7f1eb591b32032c0c
Put absolute time in timestamp title
Charles Lehner committed on 7/10/2016, 4:21:41 PMParent: 18524fccf4dfb71af2ebb049d12b40ba308d6e1b
Files changed
modules/timestamp.js | changed |
modules/timestamp.js | ||
---|---|---|
@@ -1,9 +1,9 @@ | ||
1 | 1 | var h = require('hyperscript') |
2 | 2 | var moment = require('moment') |
3 | 3 | |
4 | 4 | function updateTimestampEl(el) { |
5 | - el.firstChild.nodeValue = moment(el.timestamp).fromNow() | |
5 | + el.firstChild.nodeValue = el.timestamp.fromNow() | |
6 | 6 | return el |
7 | 7 | } |
8 | 8 | |
9 | 9 | setInterval(function () { |
@@ -11,9 +11,11 @@ | ||
11 | 11 | els.forEach(updateTimestampEl) |
12 | 12 | }, 60e3) |
13 | 13 | |
14 | 14 | exports.message_meta = function (msg) { |
15 | + var m = moment(msg.value.timestamp) | |
15 | 16 | return updateTimestampEl(h('a.enter.timestamp', { |
16 | 17 | href: '#'+msg.key, |
17 | - timestamp: msg.value.timestamp | |
18 | + timestamp: m, | |
19 | + title: m.format('LLLL') | |
18 | 20 | }, '')) |
19 | 21 | } |
Built with git-ssb-web