Skip to content

Date Input

Default Component

html
<date-input v-model="pickedDate" />

Result

Component Using Input and Output Format

For the input-format

  • D/d represents a single or double digit day
  • M/m represents a single or double digit month
  • DD/dd represents a double digit day (and requires a padding zero with single digits)
  • MM/mm represents a double digit month (and requires a padding zero with single digits)
  • YYYY/yyyy represents a four digit year

For the output-formatuseDateFormat of VueUse is used and all format options documented there apply.

html
<date-input
    v-model="pickedDate"
    input-format="D/M/YYYY"
    output-format="DD MMMM YYYY"
/>

Result

Properties

NameTypeDefaultDescription
modelValueDateThe date displayed after applying the output format
inputFormatString'YYYY-MM-DD'The required input format of a string to be interpreted as a date
outputFormatString'YYYY-MM-DD'The output format of an accepted date
showToggleBooleanfalseWhen true a toggle is shown which allows a datepicker behavior

Events

NameArgumentsDescription
update:modelValuepickedDate - Date | Nullemitted when input element receives a blur event or when the close button of a picked date is clicked
toggle-datepickerdatepickerVisibilty - Booleanemitted when datepicker toggle is clicked