Skip to content

Instantly share code, notes, and snippets.

@scumola
Last active June 24, 2016 17:49
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 scumola/fa9fefdb1ecb87c83d768d6ffe200fee to your computer and use it in GitHub Desktop.
Save scumola/fa9fefdb1ecb87c83d768d6ffe200fee to your computer and use it in GitHub Desktop.
var filedate = moment(response.headers["Last-Modified"]);
var now = moment().subtract(1000, 'seconds');
assert(filedate.isBefore(now), "file is > 1000 seconds old");
This doesn't seem to work either - always asserts that the file is old.
var filedate = moment(response.headers["Last-Modified"]);
var now = moment();
assert(filedate.isBefore(now.subtract(100000, 'seconds')), "file is > 100000 seconds old");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment