PacemCalendarPickerElement
is the optimal webcomponent for date picking.
PacemCalendarPickerElement
value can be formatted given straight attribute or relevant metadata.
Noteworthy to say:
A Calendar Picker whose value is required (
required
attribute set totrue
) cannot be cleared: the relevant button gets hidden.
[ {"prop": "bday", "type": "date", "display": { "name": "Birthday", "ui": "calendar", "watermark": "date before 2021...", "format": { "month": "short", "year": "numeric", "day": "2-digit", "weekday": "short" } }, "extra": { "disabledRanges": [{ "from": "2021-01-01" }]} , "validators": [{ "type": "required", "errorMessage": "Required field" }, {"type": "range", "errorMessage": "No way, you can't'", "params": { "max": "2020-12-31"} }] } ]