tid.js

1.2.0 • Public • Published

Tid.js

npm version

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)

Usage

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.

Installation

Add <script src="tid.min.js"></script>

Name

Tid is simply time in Norwegian. And since naming is a Hard Problem in programming I kept it very simple. :)

License

MIT © Sondre Nilsen

Package Sidebar

Install

npm i tid.js

Homepage

tid.eons.io/

Weekly Downloads

0

Version

1.2.0

License

MIT

Unpacked Size

9.07 kB

Total Files

7

Last publish

Collaborators

  • sondr3