git ssb

2+

mixmix / ticktack



Tree: 88a4effe3da2a03ed03ae73fba9b3cd1413a1a9b

Files: 88a4effe3da2a03ed03ae73fba9b3cd1413a1a9b / message / html / timeago.js

520 bytesRaw
1const nest = require('depnest')
2const { h } = require('mutant')
3const humanTime = require('human-time')
4
5exports.gives = nest('message.html.timeago')
6
7exports.create = function (api) {
8 return nest('message.html.timeago', timeago)
9
10 function timeago (msg) {
11 const { timestamp } = msg.value
12
13 // TODO implement the light auto-updating of this app-wide
14 // perhaps by adding an initializer which sweeps for data-timestamp elements and updates them
15 return h('Timeago', humanTime(new Date(timestamp)))
16 }
17}
18

Built with git-ssb-web