feat: add weekday abbreviation to flight results table
Each date row now shows e.g. "WED 2026-04-01" — the 3-letter weekday prefix is rendered in muted monospace before the date string. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,9 @@ const formatPrice = (price?: number) =>
|
|||||||
const formatDate = (d: string) =>
|
const formatDate = (d: string) =>
|
||||||
new Date(d).toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric' });
|
new Date(d).toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric' });
|
||||||
|
|
||||||
|
const WEEKDAYS = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];
|
||||||
|
const weekday = (d: string) => WEEKDAYS[new Date(d).getDay()];
|
||||||
|
|
||||||
export default function ScanDetails() {
|
export default function ScanDetails() {
|
||||||
const { id } = useParams<{ id: string }>();
|
const { id } = useParams<{ id: string }>();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -383,7 +386,10 @@ export default function ScanDetails() {
|
|||||||
<tbody className="divide-y divide-[#D4EDDA]">
|
<tbody className="divide-y divide-[#D4EDDA]">
|
||||||
{(flightsByDest[route.destination] || []).map((f) => (
|
{(flightsByDest[route.destination] || []).map((f) => (
|
||||||
<tr key={f.id} className="hover:bg-[#EEF7F0] transition-colors">
|
<tr key={f.id} className="hover:bg-[#EEF7F0] transition-colors">
|
||||||
<td className="pl-12 pr-4 py-2.5 text-sm text-on-surface">{f.date}</td>
|
<td className="pl-12 pr-4 py-2.5 text-sm text-on-surface">
|
||||||
|
<span className="font-mono text-xs font-semibold text-on-surface-variant mr-2">{weekday(f.date)}</span>
|
||||||
|
{f.date}
|
||||||
|
</td>
|
||||||
<td className="px-4 py-2.5 text-sm text-on-surface-variant">{f.airline || '—'}</td>
|
<td className="px-4 py-2.5 text-sm text-on-surface-variant">{f.airline || '—'}</td>
|
||||||
<td className="px-4 py-2.5 text-sm text-on-surface-variant font-mono">{f.departure_time || '—'}</td>
|
<td className="px-4 py-2.5 text-sm text-on-surface-variant font-mono">{f.departure_time || '—'}</td>
|
||||||
<td className="px-4 py-2.5 text-sm text-on-surface-variant font-mono">{f.arrival_time || '—'}</td>
|
<td className="px-4 py-2.5 text-sm text-on-surface-variant font-mono">{f.arrival_time || '—'}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user