Commit fdf74ff85a96f84b69b048224dc848094659b533
revert to human-time defaults
Ev Bogue committed on 10/31/2016, 12:58:03 AMParent: db08248601a75fff9e92246d75b015ee85e76bb6
Files changed
modules/timestamp.js | changed |
modules/timestamp.js | ||
---|---|---|
@@ -1,12 +1,7 @@ | ||
1 | 1 … | var h = require('hyperscript') |
2 | -var _human = require('human-time') | |
2 … | +var human = require('human-time') | |
3 | 3 … | |
4 | -function human (date) { | |
5 | - var s =_human(date).split(' ') | |
6 | - return s[0] + (s[1] == 'month' ? 'M' : s[1][0]) | |
7 | -} | |
8 | - | |
9 | 4 … | function updateTimestampEl(el) { |
10 | 5 … | el.firstChild.nodeValue = human(new Date(el.timestamp)) |
11 | 6 … | return el |
12 | 7 … | } |
@@ -16,14 +11,11 @@ | ||
16 | 11 … | els.forEach(updateTimestampEl) |
17 | 12 … | }, 60e3) |
18 | 13 … | |
19 | 14 … | exports.message_meta = function (msg) { |
20 | - var d = new Date(msg.value.timestamp) | |
21 | 15 … | return updateTimestampEl(h('a.enter.timestamp', { |
22 | 16 … | href: '#'+msg.key, |
23 | 17 … | timestamp: msg.value.timestamp, |
24 | - title: _human(d) + '\n'+d | |
18 … | + title: new Date(msg.value.timestamp) | |
25 | 19 … | }, '')) |
26 | 20 … | } |
27 | 21 … | |
28 | - | |
29 | - |
Built with git-ssb-web