DateTime (beta) (code)
Allows you to display a date in a consistent way through the use of formats.
import { DateTime } from '@mediahuis/chameleon-react'
Props
System Props
System Props
Next to the properties listed in the propstable, a collection of system props can be added to any component for further general styling and layouting purposes. These props vary per component.
To read more about the system, click here to check out its dedicated page.
Date
Timestamp string of the date to be displayed. Provide this in the ISO8601 format that is understood by the native Date object.
import { DateTime } from '@mediahuis/chameleon-react'
Format
Date and time formatting setting. Refer to the dayjs docs for all available settings.
On top of the dayjs formats, you can also supply . Under the hood this uses dayjs' RelativeTime plugin.
Each brand has a few tokens which contain some default formats.
import { dateTimeFormatDefault, dateTimeFormatDate, dateTimeFormatTime, dateTimeFormatDateTime } from '@mediahuis/chameleon-theme-wl'
import { DateTime } from '@mediahuis/chameleon-react'