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}
/>