WIP checkpoint
This commit is contained in:
@@ -19,6 +19,7 @@ export type FuelPrice = {
|
||||
export type EventItem = {
|
||||
title: string;
|
||||
slug: string;
|
||||
summary?: string;
|
||||
description: string;
|
||||
start_datetime: string;
|
||||
end_datetime?: string;
|
||||
@@ -81,6 +82,7 @@ export const fallbackEvents: EventItem[] = [
|
||||
{
|
||||
title: 'Airfield open day',
|
||||
slug: 'airfield-open-day',
|
||||
summary: 'A family-friendly open day with aircraft on display and pilot meet-and-greets.',
|
||||
description: 'Example event to verify the listing and detail page flow.',
|
||||
start_datetime: '2026-06-14T09:00:00Z',
|
||||
end_datetime: '2026-06-14T16:00:00Z',
|
||||
|
||||
@@ -23,3 +23,24 @@ export function formatDateTime(value?: string) {
|
||||
minute: '2-digit',
|
||||
}).format(new Date(value));
|
||||
}
|
||||
|
||||
export function formatWeekday(value?: string) {
|
||||
if (!value) {
|
||||
return 'TBC';
|
||||
}
|
||||
|
||||
return new Intl.DateTimeFormat('en-GB', {
|
||||
weekday: 'long',
|
||||
}).format(new Date(value));
|
||||
}
|
||||
|
||||
export function formatTime(value?: string) {
|
||||
if (!value) {
|
||||
return 'Time TBC';
|
||||
}
|
||||
|
||||
return new Intl.DateTimeFormat('en-GB', {
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
}).format(new Date(value));
|
||||
}
|
||||
|
||||
+15
-4
@@ -6,14 +6,25 @@ export const site = {
|
||||
openingHours: '7 days 0900-1600',
|
||||
licensedHours: 'Friday to Sunday 0900-1700',
|
||||
runwayFacts: [
|
||||
'Runway 04/22 concrete 1351m x 30m licensed',
|
||||
'Runway 10/28 asphalt 857m x 18m unlicensed',
|
||||
'Category 1 RFFS',
|
||||
'Runway 22 - 1200x45m LDA (Concrete) Code 2 (Right Hand)',
|
||||
'Runway 04 - 1200x45m LDA (Concrete) Code 2 (Left Hand)',
|
||||
'Runway 10 - 824x18m LDA (Asphalt) Code 1 (Right Hand)',
|
||||
'Runway 28 - 794x18m LDA (Asphalt) Code 1 (Left Hand)',
|
||||
'Category 1 RFFS (When Licensed)',
|
||||
'Air Ground Service 119.705',
|
||||
],
|
||||
navigation: [
|
||||
{ label: 'Home', href: '/' },
|
||||
{ label: 'Visiting Pilots', href: '/visiting-pilots/' },
|
||||
{ label: 'Pilot Info', href: '/pilot-info/' },
|
||||
{
|
||||
label: 'About',
|
||||
href: '/about/',
|
||||
children: [
|
||||
{ label: 'Drones', href: '/about/drones/' },
|
||||
{ label: 'Noise', href: '/about/noise/' },
|
||||
{ label: 'Volunteering', href: '/about/volunteering/' },
|
||||
],
|
||||
},
|
||||
{ label: 'Procedures', href: '/procedures-safety-noise-abatement/' },
|
||||
{ label: 'Events', href: '/events/' },
|
||||
{ label: 'News', href: '/news/' },
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
export function normalizeSlug(value?: string | null): string | null {
|
||||
if (!value) return null;
|
||||
|
||||
const trimmed = value.trim();
|
||||
if (!trimmed) return null;
|
||||
|
||||
return trimmed.replace(/^\/+|\/+$/g, '').toLowerCase();
|
||||
}
|
||||
Reference in New Issue
Block a user