mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 06:51:12 -05:00
Fix date display issues
This commit is contained in:
@@ -117,7 +117,7 @@ export function ParkListView({ parks, onParkClick }: ParkListViewProps) {
|
||||
{park.opening_date && (
|
||||
<Badge variant="outline" className="text-xs">
|
||||
<Calendar className="w-3 h-3 mr-1" />
|
||||
Opened {new Date(park.opening_date).getFullYear()}
|
||||
Opened {park.opening_date.split('-')[0]}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -68,7 +68,7 @@ export function EnhancedSearchResults({ results, loading, hasMore, onLoadMore }:
|
||||
{parkData?.opening_date && (
|
||||
<div className="flex items-center gap-1 text-xs text-muted-foreground">
|
||||
<Calendar className="w-3 h-3" />
|
||||
<span>Opened {new Date(parkData.opening_date).getFullYear()}</span>
|
||||
<span>Opened {parkData.opening_date.split('-')[0]}</span>
|
||||
</div>
|
||||
)}
|
||||
{parkData?.status && (
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user