Skip to content

Instantly share code, notes, and snippets.

@goofmint

goofmint/index.js

Created May 15, 2018
Embed
What would you like to do?
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