Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Momentjs isAfter is always returning false "bug"
// Not quite the solution, but it works so I can move on!
// CHANGEME: a date to test against, change it to something you want
var dateToTest = moment('2015-02-04 08:00:00').valueOf();
// now
var now = moment().valueOf();
// use a "greater than" eval, rather than isAfter
var x = dateToTest > now;
console.log('isAfterTest', now, '>', dateToTest, x);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment