Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brianvanburken/elm-list-date
Functions to deal with dates represented as a List of Int's
https://github.com/brianvanburken/elm-list-date
date elm elm-lang time
Last synced: about 1 month ago
JSON representation
Functions to deal with dates represented as a List of Int's
- Host: GitHub
- URL: https://github.com/brianvanburken/elm-list-date
- Owner: brianvanburken
- License: bsd-3-clause
- Created: 2018-05-31T13:43:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-12T11:08:11.000Z (about 2 years ago)
- Last Synced: 2024-10-13T20:21:04.185Z (2 months ago)
- Topics: date, elm, elm-lang, time
- Language: Elm
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elm-list-date
Sometimes an API returns a List of Int's and you have to deal with it. This
package helps with the conversion from and to elm's native [`Time`](https://package.elm-lang.org/packages/elm/time/1.0.0/).## Installation
```bash
elm install brianvanburken/elm-list-date
```## Usage
See [docs](https://package.elm-lang.org/packages/brianvanburken/elm-list-date/latest).
### Decoding
```elm
listToDate Time.utc [ 2018, 5, 31, 15, 16, 20, 987 ] -- Ok (Posix 1527779780987)
```### Encoding
```elm
dateToList Time.utc (Posix 1527779780987) -- [ 2018, 5, 31, 15, 16, 20, 987 ]
```