git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: 7c4d6df66f14e6f9d83ca2763a2fcd102369592e

Files: 7c4d6df66f14e6f9d83ca2763a2fcd102369592e / message / html / timestamp.js

491 bytesRaw
1const h = require('mutant/h')
2const nest = require('depnest')
3
4exports.gives = nest('message.html.timestamp')
5exports.needs = nest({
6 'lib.obs.timeAgo': 'first',
7 'message.sync.timestamp': 'first'
8})
9
10exports.create = function (api) {
11 return nest('message.html.timestamp', timestamp)
12
13 function timestamp (msg) {
14 return h('a.Timestamp', {
15 href: msg.key,
16 title: new Date(api.message.sync.timestamp(msg))
17 }, api.lib.obs.timeAgo(api.message.sync.timestamp(msg)))
18 }
19}
20

Built with git-ssb-web