Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created May 15, 2018 04:15
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 goofmint/9bf192e624c46276506c210bb9fd6515 to your computer and use it in GitHub Desktop.
Save goofmint/9bf192e624c46276506c210bb9fd6515 to your computer and use it in GitHub Desktop.
today = new Date;
weekago = new Date - 24 * 1000 * 60 * 60 * 7;
openRange = IDBKeyRange.bound(weekago, today, true, true);
openRange.includes(today); // false
openRange.includes(new Date(today - 1)); // true
openRange.includes(weekago); // false
openRange.includes(new Date(weekago - 1 + 2)); // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment