fix: use Ecuador timezone (GMT-5) for all date displays across the app
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { useState, useEffect, useRef, useCallback } from 'react';
|
||||
import { formatDisplayDate, formatDisplayDateTime } from '@/lib/date';
|
||||
|
||||
type Image = { id: number; filename: string; data: string; category: string; room_id: number | null; location_target: string; uploaded_at: string };
|
||||
type Slide = { id: number; title: string; subtitle: string; image_url: string | null; image_id: number | null; active: boolean; sort_order: number };
|
||||
@@ -1168,7 +1169,7 @@ function TripsSection({ onToast }: { onToast: (msg: string, type: string) => voi
|
||||
<div style={{ fontSize: '13px', color: C.textLight }}>{t.room_name || 'No room assigned'}</div>
|
||||
</div>
|
||||
<div style={{ fontSize: '13px', color: C.text }}>
|
||||
<strong>In:</strong> {new Date(t.check_in).toLocaleDateString()} · <strong>Out:</strong> {new Date(t.check_out).toLocaleDateString()}
|
||||
<strong>In:</strong> {formatDisplayDate(t.check_in)} · <strong>Out:</strong> {formatDisplayDate(t.check_out)}
|
||||
</div>
|
||||
<Badge color={t.status === 'confirmed' ? C.success : t.status === 'checked_in' ? '#1976d2' : t.status === 'cancelled' ? C.danger : '#666'}>{t.status.replace('_', ' ')}</Badge>
|
||||
<div style={{ display: 'flex', gap: '8px' }}>
|
||||
@@ -1282,7 +1283,7 @@ function MessagesSection({ onToast }: { onToast: (msg: string, type: string) =>
|
||||
<div style={{ maxWidth: '70%', padding: '10px 14px', borderRadius: 12, background: m.sender_role === 'admin' ? C.gold : '#f0f0f0', color: m.sender_role === 'admin' ? '#fff' : C.navy }}>
|
||||
<div style={{ fontSize: '12px', fontWeight: 500, marginBottom: '4px' }}>{m.sender_role === 'admin' ? 'Staff' : 'Guest'}</div>
|
||||
<div style={{ fontSize: '14px' }}>{m.message}</div>
|
||||
<div style={{ fontSize: '11px', opacity: 0.7, marginTop: '4px' }}>{new Date(m.created_at).toLocaleString('en-US', { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' })}</div>
|
||||
<div style={{ fontSize: '11px', opacity: 0.7, marginTop: '4px' }}>{formatDisplayDateTime(m.created_at)}</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
@@ -1975,7 +1976,7 @@ function UsersSection({ onToast }: { onToast: (msg: string, type: string) => voi
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: C.textLight }}>
|
||||
{u.first_name || ''} {u.last_name || ''} {u.email ? `• ${u.email}` : ''} {u.country ? `• ${u.country}` : ''}
|
||||
{u.terms_accepted_at ? `• Terms: ${new Date(u.terms_accepted_at).toLocaleDateString()}` : '• Terms not accepted'}
|
||||
{u.terms_accepted_at ? `• Terms: ${formatDisplayDate(u.terms_accepted_at)}` : '• Terms not accepted'}
|
||||
{u.comments_disabled ? '• Comments disabled' : ''}
|
||||
</div>
|
||||
</div>
|
||||
@@ -2005,7 +2006,7 @@ function UsersSection({ onToast }: { onToast: (msg: string, type: string) => voi
|
||||
<Tgl label="Disable comments" checked={editing.comments_disabled || false} onChange={(v: boolean) => setEditing({ ...editing, comments_disabled: v })} />
|
||||
{editing.terms_accepted_at && (
|
||||
<div style={{ fontSize: 12, color: C.textLight }}>
|
||||
Terms accepted: {new Date(editing.terms_accepted_at).toLocaleString()}
|
||||
Terms accepted: {formatDisplayDateTime(editing.terms_accepted_at)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user