mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-25 15:51:12 -05:00
Fix date display and edit form issues
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { Building, MapPin, Calendar, Globe, ExternalLink, AlertCircle } from 'lucide-react';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { FlexibleDateDisplay } from '@/components/ui/flexible-date-display';
|
||||
import type { DatePrecision } from '@/components/ui/flexible-date-input';
|
||||
import type { CompanySubmissionData } from '@/types/submission-data';
|
||||
|
||||
interface RichCompanyDisplayProps {
|
||||
@@ -63,12 +65,11 @@ export function RichCompanyDisplay({ data, actionType, showAllFields = true }: R
|
||||
</div>
|
||||
<div className="text-sm ml-6">
|
||||
{data.founded_date ? (
|
||||
<>
|
||||
<span className="font-medium">{new Date(data.founded_date).toLocaleDateString()}</span>
|
||||
{data.founded_date_precision && data.founded_date_precision !== 'day' && (
|
||||
<span className="text-xs text-muted-foreground ml-1">({data.founded_date_precision})</span>
|
||||
)}
|
||||
</>
|
||||
<FlexibleDateDisplay
|
||||
date={data.founded_date}
|
||||
precision={(data.founded_date_precision as DatePrecision) || 'day'}
|
||||
className="font-medium"
|
||||
/>
|
||||
) : (
|
||||
<span className="font-medium">{data.founded_year}</span>
|
||||
)}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Building2, MapPin, Calendar, Globe, ExternalLink, Users, AlertCircle } from 'lucide-react';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { FlexibleDateDisplay } from '@/components/ui/flexible-date-display';
|
||||
import type { DatePrecision } from '@/components/ui/flexible-date-input';
|
||||
import type { ParkSubmissionData } from '@/types/submission-data';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { supabase } from '@/lib/supabaseClient';
|
||||
@@ -154,19 +156,21 @@ export function RichParkDisplay({ data, actionType, showAllFields = true }: Rich
|
||||
{data.opening_date && (
|
||||
<div>
|
||||
<span className="text-muted-foreground">Opened:</span>{' '}
|
||||
<span className="font-medium">{new Date(data.opening_date).toLocaleDateString()}</span>
|
||||
{data.opening_date_precision && data.opening_date_precision !== 'day' && (
|
||||
<span className="text-xs text-muted-foreground ml-1">({data.opening_date_precision})</span>
|
||||
)}
|
||||
<FlexibleDateDisplay
|
||||
date={data.opening_date}
|
||||
precision={(data.opening_date_precision as DatePrecision) || 'day'}
|
||||
className="font-medium"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{data.closing_date && (
|
||||
<div>
|
||||
<span className="text-muted-foreground">Closed:</span>{' '}
|
||||
<span className="font-medium">{new Date(data.closing_date).toLocaleDateString()}</span>
|
||||
{data.closing_date_precision && data.closing_date_precision !== 'day' && (
|
||||
<span className="text-xs text-muted-foreground ml-1">({data.closing_date_precision})</span>
|
||||
)}
|
||||
<FlexibleDateDisplay
|
||||
date={data.closing_date}
|
||||
precision={(data.closing_date_precision as DatePrecision) || 'day'}
|
||||
className="font-medium"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Train, Gauge, Ruler, Zap, Calendar, Building, User, ExternalLink, AlertCircle, TrendingUp, Droplets, Sparkles, RotateCw, Baby, Navigation } from 'lucide-react';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { FlexibleDateDisplay } from '@/components/ui/flexible-date-display';
|
||||
import type { DatePrecision } from '@/components/ui/flexible-date-input';
|
||||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';
|
||||
import { ChevronDown, ChevronRight } from 'lucide-react';
|
||||
import type { RideSubmissionData } from '@/types/submission-data';
|
||||
@@ -602,19 +604,21 @@ export function RichRideDisplay({ data, actionType, showAllFields = true }: Rich
|
||||
{data.opening_date && (
|
||||
<div>
|
||||
<span className="text-muted-foreground">Opened:</span>{' '}
|
||||
<span className="font-medium">{new Date(data.opening_date).toLocaleDateString()}</span>
|
||||
{data.opening_date_precision && data.opening_date_precision !== 'day' && (
|
||||
<span className="text-xs text-muted-foreground ml-1">({data.opening_date_precision})</span>
|
||||
)}
|
||||
<FlexibleDateDisplay
|
||||
date={data.opening_date}
|
||||
precision={(data.opening_date_precision as DatePrecision) || 'day'}
|
||||
className="font-medium"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{data.closing_date && (
|
||||
<div>
|
||||
<span className="text-muted-foreground">Closed:</span>{' '}
|
||||
<span className="font-medium">{new Date(data.closing_date).toLocaleDateString()}</span>
|
||||
{data.closing_date_precision && data.closing_date_precision !== 'day' && (
|
||||
<span className="text-xs text-muted-foreground ml-1">({data.closing_date_precision})</span>
|
||||
)}
|
||||
<FlexibleDateDisplay
|
||||
date={data.closing_date}
|
||||
precision={(data.closing_date_precision as DatePrecision) || 'day'}
|
||||
className="font-medium"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user