Quick question about TRPC query with date
Hi,
Just a quick question about TRPC Query
why do I always get the same date in the query? Date in this case is a state.
How do I make it work when I change the date to re-trigger this query? I tried
refetch
but did not work same date again.20 Replies
This is the date I always get when selected in a calendar
I think setting the state should automatically run the query again
Can you show the code when you set / change the date?
where does date come from?
this is a a react question, not a trpc/react query question, btw
its a react/trpc
you are right @cje
this is how i set the date
this is the component and what happens on click
and below i have state output
but the thing thats input in the TRPC is always this
so I'm hella confused
i think its the format
how can I do this in trpc?
it has nothing to do with trpc
have you tried logging the date before the query is created?
yes
you see the date in TRPC is TZ format thingy
and mine on the frontend is the normal one
so I suppose TRPC expects me to have a TZ Iso format
and not the default one?
why would that make it stale
why by default is the date saved like this lol ?
I need to find posts where datetimes are between date-fns.startOfDay(date) and date-fns.endOfDaty(date)
its working now