A calm place to write long-form, and publish it to the open social web.
skypress.blog/
1/**
2 * Format an ISO date/datetime as a long English date, e.g. "June 9, 2026".
3 *
4 * The reading pages are server-rendered and the UI is English, so we render a
5 * fixed `en-US` long format rather than negotiating the reader's locale (which
6 * would need client JS — disallowed on the read path). `timeZone: 'UTC'` pins
7 * the rendered calendar day so a late-evening UTC timestamp can't roll to the
8 * next day on a server in a western zone.
9 */
10const longDate = new Intl.DateTimeFormat( 'en-US', {
11 dateStyle: 'long',
12 timeZone: 'UTC',
13} );
14
15export function formatLongDate( iso: string ): string {
16 // Document dates come from untrusted PDS records; a malformed value would make
17 // Intl's format() throw (RangeError), so fall back to the raw string.
18 const date = new Date( iso );
19 return Number.isNaN( date.getTime() ) ? iso : longDate.format( date );
20}