Fix date display issues

This commit is contained in:
gpt-engineer-app[bot]
2025-10-02 16:34:38 +00:00
parent 502d893e38
commit 3c7de96bcf
4 changed files with 4 additions and 4 deletions

View File

@@ -156,7 +156,7 @@ export default function Parks() {
// Opening year filter
if (filters.openingYearStart || filters.openingYearEnd) {
const openingYear = park.opening_date ? new Date(park.opening_date).getFullYear() : null;
const openingYear = park.opening_date ? parseInt(park.opening_date.split('-')[0]) : null;
if (openingYear) {
if (filters.openingYearStart && openingYear < filters.openingYearStart) return false;
if (filters.openingYearEnd && openingYear > filters.openingYearEnd) return false;

View File

@@ -472,7 +472,7 @@ export default function RideDetail() {
<div>
<div className="font-medium">Opened</div>
<div className="text-sm text-muted-foreground">
{new Date(ride.opening_date).getFullYear()}
{ride.opening_date.split('-')[0]}
</div>
</div>
</div>