Skip to main content

Date Picker

Description

<jp-datepicker> is a field component with <input type="date"> functionality.


Attributes

NameRequiredTypeDescription
namestringname of the form control
valueDate() constructor paramsetter
labelstringlabel displayed on date field
labelType'outside' or 'inside'whether label is inside or outside of the field
enableMultiplebooleandetermines if multiple dates can be selected
separatorstringstring between the dates
requiredbooleandetermines if date needs to be selected
requiredValidationMessagestringvalidation message for when component does not satisfy required
returnFormatcustom | json | unix | js | utc | iso | isoDateformat of exposing value (through events and methods)
returnFormatFunctionif returnFormat
is custom
(date:Date) => anycustom return format function
displayFormatcustom | normal | short | medium | long | fullformat of displayed date in the field
displayFormatFunctionif displayFormat
is custom
(date:Date) => stringcustom display format function
minDatestring | Dateminimum date that can be selected
maxDatestring | Datemaximum date that can be selected


Slots

This component does not have any slots.



Methods

  • getValue
    • returns form field value
  • reportValidity
    • triggers reportValidity


Events

  • value
    • triggers when value of the field changes


Demo

Live Editor
// import '@jaspero/web-components/datepicker.wc.js';
// import '@jaspero/web-components/datepicker.css';

<jp-datepicker label="Pick a date"></jp-datepicker>
Result
Loading...