Immutable moment.js with composable functions and partial application of data
$ npm install momento
const nextWeek = pipe(
parse('DD/MM/YYYY'),
add('days', 7),
format('DD/MM/YYYY')
)
nextWeek('10/12/2017')Same as moment.add()
add('days', 2, now())Same as moment.format()
format('DD/MM/YYYY', now())Same as moment.milliseconds()
getMilliseconds(now())Same as moment.seconds()
getSeconds(now())Same as moment() without arguments
now()Same as moment() with two arguments
parse('DD/MM/YYYY', '31/10/1993')Same as moment() with one argument
parseISO('1993-10-31')Same as moment.unix()
parseUnix(752041500)Same as moment.subtract()
subtract('days', 2, now())Fell free to send a Pull Request! ❤️