My console log is giving me an unexpected output.
var bool = (moment(\"2017-04-08 23:00:00\").isBefore(moment(\"2017-04-09 01:00:00\", \'day\')));
console.lo
The moment(...)
argument does not accept the 'day' parameter.
Instead, you should be calling isBefore(...)
with the day parameter like so:
moment(...).isBefore(moment(...), 'day'));
More info can be found at the moment docs here.
@Oliver Charlesworth is right, moment()
doesn't accept 'day'
as a second argument. Have a look here and scroll down for all its valid signatures.
With that being said, you can either convert
isBefore(moment("2017-04-09 01:00:00", 'day'));
to
isBefore(moment('2017-04-09 01:00:00'), 'day');
or to
isBefore('2017-04-09 01:00:00', 'day')
;
Both work.
Here is the signature for isBefore.