Conversation
ogroppo
reviewed
Jul 21, 2026
ogroppo
left a comment
Contributor
There was a problem hiding this comment.
Hi mate, this is great idea! however I run into this desire before, and decided not to do this because you're assuming the timezone (UTC).
So the date should be "coerced" on the browser/client and sent up to the server with the offset.
So if you are in indonesia, and have a datepicker that sends up only the date, you gonna have quite a few results missing!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
react-admin date inputs emit
YYYY-MM-DD, but Prisma requires strict ISO-8601 andrejects date-only strings outright:
So any
createdAt_gte/createdAt_ltefilter coming from a date picker threw beforereaching the database.
extractWherenow expands date-only values on the comparisonoperators to a full timestamp at the correct day boundary.
Prisma has no built-in date-only comparison, and
@db.Datedoesn't help — it rejectsYYYY-MM-DDtoo (prisma#25455).Constructing the boundaries manually is the documented workaround.
Boundaries
The boundary depends on inclusivity, not direction, so each operator keeps a distinct meaning:
gte DD T00:00:00.000Zlte DD T23:59:59.999Zgt DD T23:59:59.999Zlt DD T00:00:00.000ZCoercion only fires on values matching
^\d{4}-\d{2}-\d{2}$. Full timestamps, numbers,and every other operator (
contains,equals,in,startsWith, …) pass through untouched.Also fixed
Nested comparison filters were double-wrapped —
{ createdAt: { gte: "..." } }became{ createdAt: { gte: { contains: "..." } } }. Nestedgt/gte/lt/ltenow resolvecorrectly. Other nested operators (
equals,contains,in) still have this bug;left for a follow-up.
_gt/_ltpreviously produced the same coerced value as_gte/_lte, making thestrict and non-strict operators indistinguishable. They now exclude the named day.
If an admin filter labelled "after" sends
_gtand expects the date included, switch itto
_gte.Known limitations
Stringcolumn holding a date-shaped value(e.g.
sku_gte: "2025-01-31") is also converted. A DMMF-based type check would fix this;tracked as a follow-up.
Tests
166 passing, including new cases for all four operators, nested filters, and non-date
values passing through unchanged.
Two notes: the nested double-wrap fix isn't in the branch's changeset yet — worth its own entry since it won't show up in the changelog otherwise. And before merging,
it's worth grepping the admin for existing _gt/_lt date filters, since those are the only ones whose behavior actually changes.