Vueye Datepicker
It's a simple date picker created using Vue.js and the vue-composition-api plugin.
Installation
npm i vueye-datepicker --save
Usage
In main.js
use the composition-api
plugin :
props and directives
prop | description | default |
---|---|---|
format | Provide the date format | 'yyyy-mm-dd' |
customFormatter | Define a custom formatter as a function that takes the date object as parameter | undefined |
color | The main color | #5118ac |
v-model
has a value an object with two fields
value
: the Date object instance.formattedValue
: the date value returned as formatted string
Note :
The clear icon × doesn't clear the input value but It initialize the date value to the current year (January 1st, currentYear)
Available formats :
The format
prop could accept one of the following formats as a value :
"yyyy/mm/dd", "dd/mm/yyyy", "mm/dd/yyyy", "yyyy-mm-dd", "dd-mm-yyyy", "mm-dd-yyyy"
The formats listed above are limited and they may not respond to your use case,
so you could define your own formatter and pass it as value of the customFormatter
prop