diff options
| author | yyamashita <yyamashita@mosquit.one> | 2026-05-06 22:09:41 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@mosquit.one> | 2026-05-06 22:09:41 +0900 |
| commit | c18885f2b022f4a8116809aa893929f2c278b319 (patch) | |
| tree | c2818ef46ff58c7e3bc4cb2bd9b8a48e5821c3f8 /app/components | |
| parent | be55729482296663da8c96723bfd22080e6762c1 (diff) | |
Limit scrape window and default event list to ~1 month
Scraper runner now filters events to today + 35 days before upserting,
so the DB only holds the upcoming month of events.
Event list loader defaults date_from/date_to to the same window when
no query params are set, and passes the values down to FilterBar so the
date inputs are pre-filled on first load.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'app/components')
| -rw-r--r-- | app/components/FilterBar.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/components/FilterBar.tsx b/app/components/FilterBar.tsx index 97a3c02..266865d 100644 --- a/app/components/FilterBar.tsx +++ b/app/components/FilterBar.tsx @@ -3,9 +3,11 @@ import type { Venue } from "~/lib/db.server"; interface Props { venues: Venue[]; + defaultDateFrom?: string; + defaultDateTo?: string; } -export default function FilterBar({ venues }: Props) { +export default function FilterBar({ venues, defaultDateFrom, defaultDateTo }: Props) { const [searchParams] = useSearchParams(); return ( @@ -45,7 +47,7 @@ export default function FilterBar({ venues }: Props) { <input name="date_from" type="date" - defaultValue={searchParams.get("date_from") ?? ""} + defaultValue={searchParams.get("date_from") ?? defaultDateFrom ?? ""} className="rounded-md bg-gray-800 border border-gray-700 px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-indigo-500" /> </div> @@ -56,7 +58,7 @@ export default function FilterBar({ venues }: Props) { <input name="date_to" type="date" - defaultValue={searchParams.get("date_to") ?? ""} + defaultValue={searchParams.get("date_to") ?? defaultDateTo ?? ""} className="rounded-md bg-gray-800 border border-gray-700 px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-indigo-500" /> </div> |
