fix: use park timezone for operating window check; show tz in hours
All checks were successful
Build and Deploy / Build & Push (push) Successful in 4m22s
All checks were successful
Build and Deploy / Build & Push (push) Successful in 4m22s
- isWithinOperatingWindow now accepts an IANA timezone and reads the current time in the park's local timezone via Intl.DateTimeFormat, fixing false positives when the server runs in UTC but parks store hours in local time (e.g. Pacific parks showing open at 6:50 AM EDT) - Remove the 1-hour pre-open buffer so parks are not marked open before their doors actually open; retain the 1-hour post-close grace period - Add getTimezoneAbbr() helper to derive the short tz label (EDT, PDT…) - All hours labels now display with the local timezone abbreviation (e.g. "10am – 6pm PDT") in WeekCalendar, ParkCard, and ParkMonthCalendar Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -56,7 +56,7 @@ export default async function ParkPage({ params, searchParams }: PageProps) {
|
||||
|
||||
// Determine if we're within the 1h-before-open to 1h-after-close window.
|
||||
const withinWindow = todayData?.hoursLabel
|
||||
? isWithinOperatingWindow(todayData.hoursLabel)
|
||||
? isWithinOperatingWindow(todayData.hoursLabel, park.timezone)
|
||||
: false;
|
||||
|
||||
if (queueTimesId) {
|
||||
@@ -125,6 +125,7 @@ export default async function ParkPage({ params, searchParams }: PageProps) {
|
||||
month={month}
|
||||
monthData={monthData}
|
||||
today={today}
|
||||
timezone={park.timezone}
|
||||
/>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user