Skip to content

Commit

Permalink
fix(VDatePicker): stay on current month when selecting multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Apr 25, 2024
1 parent d2af7e0 commit 2d13e36
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/vuetify/src/components/VDatePicker/VDatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ export const VDatePicker = genericComponent<new <
}

watch(model, (val, oldVal) => {
const before = adapter.date(wrapInArray(val)[0])
const after = adapter.date(wrapInArray(oldVal)[0])
const newMonth = adapter.getMonth(before)
const newYear = adapter.getYear(before)
const before = adapter.date(wrapInArray(oldVal)[oldVal.length - 1])
const after = adapter.date(wrapInArray(val)[val.length - 1])
const newMonth = adapter.getMonth(after)
const newYear = adapter.getYear(after)

if (newMonth !== month.value) {
month.value = newMonth
Expand Down

0 comments on commit 2d13e36

Please sign in to comment.