Vuepic / vue-datepicker

Datepicker component for Vue 3
https://vue3datepicker.com
MIT License
1.48k stars 147 forks source link

`filters` not working with `month-picker` enabled #779

Closed tmahamadou01 closed 7 months ago

tmahamadou01 commented 7 months ago

Describe the bug When using month-picker together with filters the filter does not respect the set filters.

To Reproduce Stackblitz

code:

<template>
  <div>
    <Datepicker v-model="date" month-picker :filters="filters" />
  </div>
</template>

<script setup>
import { ref, computed } from 'vue';
import Datepicker from '@vuepic/vue-datepicker';
import '@vuepic/vue-datepicker/dist/main.css';

import { getMonth, addMonths } from 'date-fns';

const date = ref();

const filters = computed(() => {
  const currentDate = new Date();
  return {
    months: Array.from(Array(3).keys()).map((item) =>
      getMonth(addMonths(currentDate, item + 1))
    ),
  };
});
</script>

Expected behavior The datePicker should deactivate the dates that are defined in the filters, but in my case, when the month-picker props is activated, the filter doesn't work.

Screenshots Capture d’écran 2024-03-12 à 13 19 22

Desktop & mobile (please complete the following information):

Jasenkoo commented 7 months ago

Duplicate of #769