Skip to content

Commit

Permalink
fix(date-picker): undefined dayIndex (#2545)
Browse files Browse the repository at this point in the history
  • Loading branch information
Malik-Jouda authored Nov 6, 2024
1 parent bf58086 commit ce955d2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/components/date-picker/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ const attrs = {
'is-dark': { selector: 'html', darkClass: 'dark' },
'first-day-of-week': 2
}
function onDayClick(_: any, event: MouseEvent): void {
const target = event.target as HTMLElement
target.blur()
}
</script>

<template>
Expand All @@ -40,11 +45,13 @@ const attrs = {
v-model.range="date"
:columns="2"
v-bind="{ ...attrs, ...$attrs }"
@dayclick="onDayClick"
/>
<VCalendarDatePicker
v-else
v-model="date"
v-bind="{ ...attrs, ...$attrs }"
@dayclick="onDayClick"
/>
</template>

Expand Down
7 changes: 7 additions & 0 deletions docs/content/2.components/date-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ const attrs = {
'is-dark': { selector: 'html', darkClass: 'dark' },
'first-day-of-week': 2
}
function onDayClick(_: any, event: MouseEvent): void {
const target = event.target as HTMLElement
target.blur()
}
</script>
<template>
Expand All @@ -78,11 +83,13 @@ const attrs = {
v-model.range="date"
:columns="2"
v-bind="{ ...attrs, ...$attrs }"
@dayclick="onDayClick"
/>
<VCalendarDatePicker
v-else
v-model="date"
v-bind="{ ...attrs, ...$attrs }"
@dayclick="onDayClick"
/>
</template>
Expand Down

0 comments on commit ce955d2

Please sign in to comment.