https://github.com/passy/purescript-simple-moment
A minimal PureScript wrapper around moment.js
https://github.com/passy/purescript-simple-moment
Last synced: 6 months ago
JSON representation
A minimal PureScript wrapper around moment.js
- Host: GitHub
- URL: https://github.com/passy/purescript-simple-moment
- Owner: passy
- License: apache-2.0
- Created: 2015-09-13T20:16:12.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-03-31T13:54:37.000Z (over 7 years ago)
- Last Synced: 2026-01-22T09:44:54.201Z (6 months ago)
- Language: PureScript
- Homepage: http://pursuit.purescript.org/packages/purescript-simple-moment/
- Size: 30.3 KB
- Stars: 7
- Watchers: 1
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# purescript-simple-moment
[](https://github.com/passy/purescript-simple-moment/releases)
[](https://travis-ci.org/passy/purescript-simple-moment)
> A minimal wrapper around a few hand-picked APIs of [moment.js](http://momentjs.com/).
For a more fully-featured library, check out
[purescript-moment](https://github.com/CapillarySoftware/purescript-moment).
## Example
```purs
tNow <- now
nowCal <- M.calendar $ M.fromDate tNow
print nowCal -- "Today at 9:47 PM"
nowStr <- M.fromNow $ M.fromDate tNow
print nowStr -- "a few seconds ago"
```
## Documentation
- [Data.Momemt.Simple](docs/Data/Moment/Simple.md)
- [Data.Moment.Simple.Relative](docs/Data/Moment/Simple/Relative.md)
- [Data.Moment.Simple.Types](docs/Data/Moment/Simple/Types.md)
- [Example](example/Main.purs)
## Motivation
While trying to port [purescript-moment](https://github.com/CapillarySoftware/purescript-moment),
to PureScript 0.7.4 I realized that most of the interfaces were obsolete now
that there are powerful abstractions for dates and times are available through
[purescript-datetime](https://github.com/purescript/purescript-datetime). Since
the remaining API almost had nothing in common with that of the original
library, I started to build a very small wrapper on my own.
## License
Apache-2