Public Access
F16 F17 F18 F19 F20 F21: import polling backs off and pauses in a hidden tab, one date format module, fake timers in the import tests, error codes instead of raw messages, one safe storage wrapper, dead code.
9 lines
589 B
JavaScript
9 lines
589 B
JavaScript
// A LocalDate from Core ("2026-09-27"), by default as a short day; noon, so no time zone moves it to the day before.
|
|
export const formatDay = (day, locale, options = {day: 'numeric', month: 'short'}) =>
|
|
new Date(`${day}T12:00:00`).toLocaleDateString(locale, options);
|
|
|
|
// An instant from the backend (ISO string or epoch millis) as a date, or as date and time.
|
|
export const formatDate = (instant, locale, options) => new Date(instant).toLocaleDateString(locale, options);
|
|
|
|
export const formatDateTime = (instant, locale, options) => new Date(instant).toLocaleString(locale, options);
|