Fixed #1942 - Calendar: the Year is incorrect for Multiple Months mode

pull/1949/head
Yiğit FINDIKLI 2022-01-04 11:41:21 +03:00
parent 65ddfc4fcf
commit 54b16a1c84
1 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,7 @@
{{getMonthName(month.month)}}
</button>
<button type="button" @click="switchToYearView" @keydown="onContainerButtonKeydown" v-if="currentView !== 'year'" class="p-datepicker-year p-link" :disabled="switchViewButtonDisabled">
{{month.year}}
{{getYear(month)}}
</button>
<span class="p-datepicker-decade" v-if="currentView === 'year'">
<slot name="decade" :years="yearPickerValues">
@ -2215,6 +2215,9 @@ export default {
getMonthName(index) {
return this.$primevue.config.locale.monthNames[index];
},
getYear(month) {
return this.currentView === 'month' ? this.currentYear : month.year;
},
onOverlayClick(event) {
if (!this.inline) {
OverlayEventBus.emit('overlay-click', {