Skip to content

Friendly description of a time difference with variable precision.

License

Notifications You must be signed in to change notification settings

jifalops/time-diff

Repository files navigation

Published on Vaadin  Directory Stars on vaadin.com/directory Published on webcomponents.org

time-diff

Friendly description of a time difference (i.e. timeago) with variable precision.

Installation

bower install --save jifalops/time-diff

Usage

Set the from and to properties. from defaults to Date.now().

Demo

<time-diff id="ex1"></time-diff><br/>
<time-diff id="ex2" relative></time-diff><br/>
<time-diff id="ex3" relative></time-diff><br/>
<time-diff id="ex4" relative min-unit="month"></time-diff><br/>
<time-diff id="ex5" relative max-unit="year"></time-diff><br/>
<time-diff id="ex6"></time-diff><br/>
<time-diff id="ex7"></time-diff><br/>

Full demo: webcomponents.org | github.

API: webcomponents.org | github.

Contributing

  1. Fork it on Github.
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

License

MIT

About

Friendly description of a time difference with variable precision.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages