-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Index on Date type does not work #101
Comments
Can you give a minimal reproduction I can actually run? Otherwise it's hard to know if the bug is where you think it is, or possibly caused by something else in your code. So it's often difficult to try to reproduce bugs without code I can run. Also, if you want to know if this is a difference in behavior between IndexedDB and fake-indexeddb, you could run the same code in the browser and see if it behaves differently there. |
Hello! Sure, no problem. PS: The code I have attached works in browser. Best regards, |
Same bug as #98, if you upgrade to the latest version then it works. Well, you also have to uncomment those |
It is strange that fake indexeddb halts. This did not happen in the past, when dates were not working. |
But thank you for solving my problem. |
It's kind of a nightmare to handle every possible case of different ways people modify the built-in Node.js timers. v6 changed how that worked #92 which maybe helped in some situations and hurt in others? idk. At the end of the day, I have to use something to schedule async events. Best solution is for people to just not modify the built-in timers. I know sometimes that's impossible to avoid, but when you're doing stuff like that, you have to be aware that you might break things. |
Hello! |
I have the following use case that does not work in Fake IndexedDb:
static upgradeSpendingsDb(db, oldVersion, newVersion, objectStores) { if (!newVersion) { return; } if (oldVersion < newVersion) { objectStores.forEach((objectStore) => { const store = db.createObjectStore(objectStore, { autoIncrement: true }); store.createIndex('byCreatedOn', 'createdOn', { unique: false }); }); } }
class CustomObject() { id = undefined; createdOn = undefined; constructor(id, createdOn) { this.id = id; this.createdOn = createdOn; } }
store.put(new CustomObject(1, new Date()));
const fromDate = new Date(forYear, forMonth, 1); const toDate = new Date(forYear, forMonth + 1, 1); const keyRange = IDBKeyRange.bound(fromDate, toDate, false, true);
Is there any other way to build the range or is this a problem in the library?
The text was updated successfully, but these errors were encountered: