Skip to content

Instantly share code, notes, and snippets.

@dancourse
Created February 4, 2015 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dancourse/50060765981ce204f292 to your computer and use it in GitHub Desktop.
Save dancourse/50060765981ce204f292 to your computer and use it in GitHub Desktop.
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