Skip to content

hotwirestudios/purescript-simple-moment

 
 

Repository files navigation

purescript-simple-moment

Latest release Build Status

A minimal wrapper around a few hand-picked APIs of moment.js.

For a more fully-featured library, check out purescript-moment.

Example

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

Motivation

While trying to port 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. 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