Skip to content
Nana UI

Formatters

Format Date

Formats a date with Intl — relative ("2 days ago"), short/medium/long absolute, or ISO.

View .md Download
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/format-date";
<nana-format-date date="2026-07-18" month="long" day="numeric" year="numeric"></nana-format-date>

Properties

PropertyAttributeTypeDefaultDescription
datedateDate | string | numbernew Date()The date — a Date, an ISO string, or a timestamp
formatformatFormatDateFormat'medium'How to render the date
localelocalestring | undefined—BCP 47 locale (defaults to the document locale)
Explore Format Date interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook