ki-format-date
@kimen/elements/ki-format-date- Source
- Agent reference
Pass YYYY-MM-DD for a calendar day, or use an ISO date-time for a timestamp.
The formatter uses the closest lang declaration, including its own. Set
time-zone to display a timestamp in an IANA time zone. Calendar dates always
keep their source day.
<ki-format-date date="2026-11-19" date-style="long" lang="es-ES"></ki-format-date>date-style and time-style accept full, long, medium and short.
With both omitted, the formatter shows a medium date. The result is a native
time element with its original ISO value in datetime.
API reference
When to use: For raw date and timestamp values in tables, records and prose.
When not to use: For an editable date or an elapsed time that should change as the clock advances.
Properties & attributes
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
date | date | string | undefined | – | ISO calendar date (YYYY-MM-DD) or ISO date-time. A timestamp without an offset uses local time. |
date-style | dateStyle | "full" | "long" | "medium" | "short" | undefined | – | Date detail. Defaults to medium when neither date style nor time style is supplied. |
lang | locale | string | undefined | – | Language tag for the formatted date. Inherits the nearest HTML lang declaration when omitted. |
time-style | timeStyle | "full" | "long" | "medium" | "short" | undefined | – | Time detail. Omit to show the date alone. |
time-zone | timeZone | string | undefined | – | IANA time zone for a timestamp. A calendar date keeps its day in every zone. |
CSS custom properties
The public styling contract of ki-format-date: reassign these tokens at :root or on a subtree — never override internals.
| Token | Description |
|---|---|
--ki-format-date-font-family | Default body font family for ki-format-date on a bare page. |