Skip to content
Date - Web Component
The Date component can be used imported from:
Playground
Parameters
The Web component uses the <z-date>
tag:
By default, all the parameters are optional or can be set in different, except for the ones marked as required
The parametrization of the component can be done with the following custom HTML params:
Name | Type | Description | Slot | A11y |
---|---|---|---|---|
date | string | The date to be displayed in the component. If none is provided, shows the current date | ||
weekday | string | The weekday to be displayed in the component. Possible values are: | ||
locale | string | The locale to be used. If not set, the default locale of the browser will be used. | ||
with-weekday | boolean | If `true`, only the weekday will be displayed. |
Parameters use
date
The date to be displayed as a date. Make sure to use a valid date string format. If not set, the current date will be used.
weekday
You can set the weekday to be displayed in the component. Possible values are: long
, short
and narrow
. If this attribute is set, the date will only be displayed with the weekday. If you want to display the weekday with the date, you can use the with-weekday
attribute.
locale
The locale to be used. If not set, the default locale of the browser will be used.
Flags
with-weekday
Same as weekday
attribute, the with-weekday
attribute sets the weekday to be displayed in the component, the only difference is that the date will also be displayed.
Setting with-weekday="true"
will display the date with the weekday in a long
format as default. The format can be changed using the weekday
attribute.
Browser support
Detected engine:
Chromium
Webkit
Gecko