git ssb

16+

Dominic / patchbay



Commit 57e457da58370df9009c5dc7f1eb591b32032c0c

Put absolute time in timestamp title

Charles Lehner committed on 7/10/2016, 4:21:41 PM
Parent: 18524fccf4dfb71af2ebb049d12b40ba308d6e1b

Files changed

modules/timestamp.jschanged
modules/timestamp.jsView
@@ -1,9 +1,9 @@
11 var h = require('hyperscript')
22 var moment = require('moment')
33
44 function updateTimestampEl(el) {
5- el.firstChild.nodeValue = moment(el.timestamp).fromNow()
5+ el.firstChild.nodeValue = el.timestamp.fromNow()
66 return el
77 }
88
99 setInterval(function () {
@@ -11,9 +11,11 @@
1111 els.forEach(updateTimestampEl)
1212 }, 60e3)
1313
1414 exports.message_meta = function (msg) {
15+ var m = moment(msg.value.timestamp)
1516 return updateTimestampEl(h('a.enter.timestamp', {
1617 href: '#'+msg.key,
17- timestamp: msg.value.timestamp
18+ timestamp: m,
19+ title: m.format('LLLL')
1820 }, ''))
1921 }

Built with git-ssb-web