git ssb

0+

ev / microbay



forked from Dominic / patchbay

Commit 9dab34ab7ae96a21f29c1916528d93a34ff4e566

Merge branch 'time' of https://github.com/clehner/patchbay into invite

Dominic Tarr committed on 7/10/2016, 11:49:52 PM
Parent: 28e76d892f8bbb14ee3e3fc73264841eeb8711b4
Parent: 57e457da58370df9009c5dc7f1eb591b32032c0c

Files changed

modules/timestamp.jschanged
modules/timestamp.jsView
@@ -1,6 +1,21 @@
11 var h = require('hyperscript')
22 var moment = require('moment')
33
4+function updateTimestampEl(el) {
5+ el.firstChild.nodeValue = el.timestamp.fromNow()
6+ return el
7+}
8+
9+setInterval(function () {
10+ var els = [].slice.call(document.querySelectorAll('.timestamp'))
11+ els.forEach(updateTimestampEl)
12+}, 60e3)
13+
414 exports.message_meta = function (msg) {
5- return h('a.enter', {href: '#'+msg.key}, moment(msg.value.timestamp).fromNow())
15+ var m = moment(msg.value.timestamp)
16+ return updateTimestampEl(h('a.enter.timestamp', {
17+ href: '#'+msg.key,
18+ timestamp: m,
19+ title: m.format('LLLL')
20+ }, ''))
621 }

Built with git-ssb-web