fix(pulse): show pulse close date instead of weekday

The pulse close label rendered only the weekday (e.g. "Closes TUESDAY"),
which is ambiguous for pulses closing more than a week out. Show the day
and month instead (e.g. "Closes 23 JUNE") on both the /pulse page and the
dispatch detail poll footer.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Hvid 2026-06-10 12:40:55 +02:00
parent 4c4df45f0c
commit b156f5b02b
2 changed files with 2 additions and 2 deletions

View file

@ -46,7 +46,7 @@ const { prev, next } = getAdjacentDispatches(d.id);
function closeDayLabel(closesAt: string): string { function closeDayLabel(closesAt: string): string {
const parsed = closesAt.includes('T') ? new Date(closesAt) : new Date(closesAt.replace(' ', 'T') + 'Z'); const parsed = closesAt.includes('T') ? new Date(closesAt) : new Date(closesAt.replace(' ', 'T') + 'Z');
return new Intl.DateTimeFormat('en-GB', { weekday: 'long', timeZone: 'Europe/Copenhagen' }).format(parsed); return new Intl.DateTimeFormat('en-GB', { day: 'numeric', month: 'long', timeZone: 'Europe/Copenhagen' }).format(parsed);
} }
function parseUtc(s: string): Date { function parseUtc(s: string): Date {

View file

@ -96,7 +96,7 @@ const featuredPreview = featured ? dispatchLongPreview(featured, 720) : '';
function closeDayLabel(closesAt: string): string { function closeDayLabel(closesAt: string): string {
return new Intl.DateTimeFormat('en-GB', { return new Intl.DateTimeFormat('en-GB', {
weekday: 'long', timeZone: 'Europe/Copenhagen', day: 'numeric', month: 'long', timeZone: 'Europe/Copenhagen',
}).format(parseUtc(closesAt)); }).format(parseUtc(closesAt));
} }