Files
progcode/web/lib/dates.mjs
T
huncode 0cb1ce1f15
Build and deploy / deploy (push) Successful in 5m24s
Preserve historical publication days across build timezones
2026-10-26 20:09:03 +03:00

6 lines
353 B
JavaScript

// Archived publication timestamps are UTC; their UTC calendar days match the
// visible source dates and dated permalinks. Never use the build/browser timezone.
export function formatDate(date, {day = '2-digit', month = 'long'} = {}) {
return new Intl.DateTimeFormat('ru-RU', {day, month, year: 'numeric', timeZone: 'UTC'}).format(new Date(date));
}