(optional) Defines the style used to format the date. Also affects duration formatting when using ISO 8601 duration strings. Defaults to long.
hideCurrentYear
boolean
(optional) When true, the year is hidden if the date is in the current year, for any dateStyle (e.g. "4. feb." instead of "4. feb. 2025"). Defaults to false.
hideYear
boolean
(optional) When true, the year is always hidden from the formatted date, for any dateStyle. Defaults to false.
timeStyle
long medium short full
(optional) Defines the style used to format the time. If provided, time is included in the output.
dateTimeSeparator
string
(optional) Custom separator used between date and time when both are rendered (e.g. " - "). When not provided, uses the locale-appropriate separator (e.g. " kl. " for Norwegian, " at " for English).
relativeTime
boolean
(optional) If set to true, actual dates will be formatted as relative time (e.g., "2 hours ago"). ISO 8601 duration strings (e.g., "PT1H") are automatically detected and formatted without this prop. Defaults to false.
relativeTimeStyle
long medium short full
(optional) Defines the style used to format relative time. Defaults to dateStyle when not provided.
relativeTimeReference
function
(optional) A function that returns a Date object to use as the reference point for relative time calculations. If not provided, the current time is used.
locale
string
(optional) A string in Intl.DateTimeFormat locale format. Duration formatting supports all locales using the browser's built-in internationalization. Defaults to nb-NO.
skeleton
boolean
(optional) If set to true, an overlaying skeleton with animation will be shown.