Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report][3.6.8] Date picker with range: Can't select the same date as start/end #19989

Open
bulatgab opened this issue Jun 11, 2024 · 2 comments · May be fixed by #19990
Open

[Bug Report][3.6.8] Date picker with range: Can't select the same date as start/end #19989

bulatgab opened this issue Jun 11, 2024 · 2 comments · May be fixed by #19990

Comments

@bulatgab
Copy link

Environment

Vuetify Version: 3.6.8
Last working version: 2.7.1
Vue Version: 3.4.27
Browsers: Firefox 126.0
OS: Mac OS 10.15

Steps to reproduce

We really need the user to be able to pick the same date as the start and the end in the v-date-picker (with multiple="range").

Expected Behavior

The user can click twice on the same date and get [sameDate, sameDate] as a value

Actual Behavior

The date selection is reset on the second click

Reproduction Link

https://play.vuetifyjs.com/#...

@bulatgab
Copy link
Author

I think it's all about removing the first if here (line 101 in VDatePickerMonth.tsx):

        if (adapter.isSameDay(_value, rangeStart.value)) {
          rangeStart.value = undefined
          model.value = []
          return
        } else if (adapter.isBefore(_value, rangeStart.value)) {
          rangeStop.value = adapter.endOfDay(rangeStart.value)
          rangeStart.value = _value
        } else {
          rangeStop.value = adapter.endOfDay(_value)
        }

@bulatgab
Copy link
Author

Just to reiterate, the behaviour was correct in Vuetify 2. It was possible to click on the same date twice and choose it as a range.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant