time-diff
Friendly description of a time difference with variable precision.
[ This description is mirrored from README.md at github.com/jifalops/time-diff on 2019-05-22 ]
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
- Fork it on Github.
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
License
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Dependencies
- polymer#Polymer/polymer#^2.0.0
- moment#^2.18.1
- Released
- 2017-06-28
- Maturity
- IMPORTED
- License
- MIT License
Compatibility
- Framework
- Polymer 2.0+
- Browser
- Browser Independent