DateStamp

View Source

NOTE: Introduced feature in v0.4.10.

DateStamp formats an ISO 8601 / RFC 3339 timestamp into a human readable string, using the user preferences provided by the Browser.

<script>
    import {DateStamp} from "@kahi-ui/framework";

    const timestamp = "2021-11-10";
</script>

<DateStamp {timestamp} />

Imports

<script>
    import {DateStamp} from "@kahi-ui/framework";
</script>

Custom Format

NOTE: By using custom format settings, the user's defaults will not be loaded and you will have to opt into each unit of information.

You can customize how each individual component of the timestamp is displayed via the day, month, weekday, and year properties respectively.

<script>
    import {DateStamp} from "@kahi-ui/framework";

    const timestamp = "2021-11-10";
</script>

<DateStamp
    day="2-digit"
    month="long"
    weekday="long"
    year="2-digit"
    {timestamp}
/>

Properties

DateStamp

Name Description Types
timestamp Sets the ISO 8601 / RFC 3339 timestamp being formatted for display.
string
calendar Alters the calendar used for calculations / formatting via Temporal Calendar Codes .
string
locale Alters the locale used for displaying internationalized text via RFC 5646 / BCP 47 language tags.
string
day Alters how a displayed day is formatted.
2-digit numeric
month Alters how a displayed month is formatted.
2-digit long narrow numeric short
weekday Alters how a displayed weekday is formatted.
long narrow short
year Alters how a displayed year is formatted.
2-digit numeric