Vuepic / vue-datepicker

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

If the start date is between disabled days, date range cannot be selected #801

Closed bilalmalkoc closed 6 months ago

bilalmalkoc commented 6 months ago

Describe the bug When selecting a date range, if the first selected date is between two disabled days, it is impossible to select another date. However, we cannot choose another date.

noDisabledRange is true but, what could i do if i want to select another daterange?

To Reproduce Steps to reproduce the behavior:

  1. Choose the 17th day of the month
  2. Try choosing another date.

Expected behavior Maybe, if click same date, it can drop daterange selection.

Screenshots

https://github.com/Vuepic/vue-datepicker/assets/23140025/dc6a9fc5-f375-49df-8794-488f690c1017

https://stackblitz.com/edit/vuepic-vue-datepicker-fjjhha?file=src%2Fcomponents%2FPlayground.vue

Desktop & mobile (please complete the following information):

Jasenkoo commented 6 months ago

This is expected behavior due to the range-diff must be at least one day. If you want to drop the selection, remove the minRange. You can also do a check on invalid select or range start/end to see if the date is between disabled dates.