Only choose year in vue-flatpickr-component

257 Views Asked by At

I got a problem with flatpickr

enter image description here

This is my code:

computed: {
    ageDatePickerConfig() {
      return {
         dateFormat: 'Y-m-d H:m:i',
         altInput: true,
         altFormat: 'd/m/Y',
         allowInput: true,
         wrap: true,
         mode: 'range',
         locale: {
          rangeSeparator: ' - ',
         },
         plugins: [
          new monthSelectPlugin({
            altFormat: 'Y',
            dateFormat: 'Y',
          }),
        ],
      }
    },
  },

----------------------------------------------------
          <flat-pickr
            v-model="dobRange"
            :config="ageDatePickerConfig"
            class="form-date-picker"
          />

As you can see, in this case, I can only reveal the date-picker to choose month. I want to the date picker reveal the year-picker. How can I do that?

0

There are 0 best solutions below