-
Notifications
You must be signed in to change notification settings - Fork 135
Open
Description
- I've validated the bug against the latest version of DB packages
Describe the bug
When using eq(…, …) with Date objects, it does a referential comparison rather than a Date#getTime() comparison. A work around is to use eq(concat(date1, ''), concat(date2, '')) but this rounds to the nearest second and discards milliseconds so it's not very good.
Expected behavior
I expected that there would be special support for Date objects, as there is already for UInt8Array and Buffer (areValuesEqual).
Date handling is already supported by gt / get / lt / let comparisons, and also in normalizeValue
db/packages/db/src/utils/comparison.ts
Line 143 in 7aedf12
| if (value instanceof Date) { |
Metadata
Metadata
Assignees
Labels
No labels