Skip to content
// Reformat ISO date variants for display (YYYY-MM-DD → "8 September 2026")
(function() {
function formatISODate(str) {
// Single date: 2026-09-08
const single = str.match(/^(\d{4})-(\d{2})-(\d{2})$/);
if (single) {
const d = new Date(str + 'T12:00:00Z');
return d.toLocaleDateString('en-GB', { day: 'numeric', month: 'long', year: 'numeric', timeZone: 'UTC' });
}
// Range: 2026-06-29/2026-07-01
const range = str.match(/^(\d{4}-\d{2}-\d{2})\/(\d{4}-\d{2}-\d{2})$/);
if (range) {
const s = new Date(range[1] + 'T12:00:00Z');
const e = new Date(range[2] + 'T12:00:00Z');
const start = s.toLocaleDateString('en-GB', { day: 'numeric', month: 'long', timeZone: 'UTC' });
const end = e.toLocaleDateString('en-GB', { day: 'numeric', month: 'long', year: 'numeric', timeZone: 'UTC' });
return start + ' – ' + end;
}
return str; // unchanged for "Choose a date later…" etc
}