BUG: Shared trip page day calculation ignores timezone (s/[shareSlug]) #3
Labels
No labels
blocked:needs-decision
bug
chore
in-progress
security/high
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AuWoMe/planish#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
In
src/app/s/[shareSlug]/page.tsx, the inlinegetDayPlans()function (line 71-82) usestoISOString().split("T")[0]to group items by day, which ignores the trip timezone. This can cause items to appear on the wrong day for non-UTC timezones.Code
Impact
/trips/[tripId]) uses the correctbuildDayPlans()from the domain module which handles timezone withtoLocaleDateString(en-CA, { timeZone: timezone })Fix
Use
buildDayPlans()from@/domain/day-planinstead of the inline implementation, passingtrip.timezone.Alternatively, use
toLocaleDateString(en-CA, { timeZone: trip.timezone })for date string computation.Fixed in commit
a5510ba: the shared trip page (/s/[shareSlug]) hand-rolled day bucketing with toISOString() (UTC), ignoring trip.timezone — items near midnight landed on the wrong day. Now uses the domain buildDayPlans(items, start, end, timezone) helper, same as the member trip page.