tid.js
is a tiny and stupidly simple library to display how long ago something
was posted online. It's forked from timeago.js
which in turn is
forked from jquery-timeago
.
Differences from the originals include:
- No need for jQuery (same as
timeago.js
) - No support for locale of any kind, it's all English
- No configuration whatsoever, add it to your site and you're done (so long as you follow the usage instructions below)
- Super tiny size (~336 bytes minified/~282 bytes gzipped)
Download the tid.min.js
script and add it to your webpage and make sure your
time
elements contains a datetime
attribute that is parseable by JavaScript
(i.e. it must be either ISO8601 or RFC2822 formatted) and it will automatically
display the relative time since it was posted. It's just that stupidly simple.
Add <script src="tid.min.js"></script>
Tid
is simply time
in Norwegian. And since naming is a Hard Problem in
programming I kept it very simple. :)
MIT © Sondre Nilsen