Vuepic / vue3-date-time-picker

Datepicker component for Vue 3
https://vue3datepicker.com
MIT License
158 stars 13 forks source link

preventMinMaxNavigation disables previous and next nav arrow with only max OR min defined #99

Closed TheVaan closed 2 years ago

TheVaan commented 2 years ago

Describe the bug The new preventMinMaxNavigation disables the previous AND next navigation arrow even if there is only max OR min defined. Switching to the previous month/year by clicking on the month/year is working, but the previous navigation arrow is disabled. Further, it's not possible to navigate to the next month via next arrow when switching to a previous month over the month selection.

To Reproduce Visit https://codesandbox.io/s/vue3-date-time-picker-preventminmaxnavigation-9wk2x?file=/src/components/Demo.vue

<Datepicker
  range
  v-model="dateRange"
  :preventMinMaxNavigation="true"
  :maxDate="new Date()"
/>

Now try to click on <. Switch month with the month selector. Now try to navigate forth by clicking on >.

Expected behavior It should be possible to navigate forth when only minDate is defined and to navigate back when only maxDate is defined. Further it should be possible to navigate forth and back, when current month is not maxDate.month.