https://github.com/sporto/time-distance
Elm time distance
https://github.com/sporto/time-distance
Last synced: 5 months ago
JSON representation
Elm time distance
- Host: GitHub
- URL: https://github.com/sporto/time-distance
- Owner: sporto
- License: mit
- Created: 2018-09-07T06:44:04.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-27T04:48:11.000Z (about 6 years ago)
- Last Synced: 2024-12-29T19:58:37.081Z (6 months ago)
- Language: Elm
- Size: 45.9 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Time distance
[ ](https://app.codeship.com/projects/304697)
Return the distance between two times in words.
e.g.
- `less than 5 seconds`
- `about 1 month`
- `over 5 year`This use the package.
## Installation
```
elm install sporto/time-distance
```## Usage
```
import Time
import Time.Distance as Distancetime1 = Time.fromMillis 1530403200000
time2 = Time.fromMillis 1530403205000Distance.inWords time1 time2 == "less than 5 seconds"
```More examples in the /test folder.
Heavily inspired by