Package Exports
- momento
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (momento) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Momento
Immutable moment.js with composable functions and partial application of data
Installation
$ npm install momento
Example with Ramda pipe
const nextWeek = pipe(
parse('DD/MM/YYYY'),
add(7, 'days'),
format('DD/MM/YYYY')
)
nextWeek('10/12/2017')
Functions
add
Same as moment.add()
add(2, 'days', now())
format
Same as moment.format()
format('DD/MM/YYYY', now())
getMilliseconds
Same as moment.milliseconds()
getMilliseconds(now())
getSeconds
Same as moment.seconds()
getSeconds(now())
now
Same as moment() without arguments
now()
parse
Same as moment() with two arguments
parse('DD/MM/YYYY', '31/10/1993')
parseISO
Same as moment() with one argument
parseISO('1993-10-31')
parseUnix
Same as moment.unix()
parseUnix(752041500)
subtract
Same as moment.subtract()
subtract(2, 'days', now())
Missing a function?
Fell free to send a Pull Request! ❤️