fix: use local time with 3am cutover for today's date
new Date().toISOString() returns UTC, causing the calendar to advance to the next day at 8pm EDT / 7pm EST. getTodayLocal() reads local wall-clock time and rolls back one day before 3am so the calendar stays on the current day through the night. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import Link from "next/link";
|
||||
import type { Park } from "@/lib/scrapers/types";
|
||||
import type { DayData } from "@/lib/db";
|
||||
import type { Region } from "@/lib/parks";
|
||||
import { getTodayLocal } from "@/lib/env";
|
||||
|
||||
interface WeekCalendarProps {
|
||||
parks: Park[];
|
||||
@@ -222,7 +223,7 @@ function ParkRow({
|
||||
}
|
||||
|
||||
export function WeekCalendar({ parks, weekDates, data, grouped }: WeekCalendarProps) {
|
||||
const today = new Date().toISOString().slice(0, 10);
|
||||
const today = getTodayLocal();
|
||||
const parsedDates = weekDates.map(parseDate);
|
||||
|
||||
const firstMonth = parsedDates[0].month;
|
||||
|
||||
Reference in New Issue
Block a user