Skip to content

Commit

Permalink
Fixed #1942 - Calendar: the Year is incorrect for Multiple Months mode
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitfindikli committed Jan 4, 2022
1 parent 65ddfc4 commit 54b16a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/calendar/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -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', {
Expand Down

0 comments on commit 54b16a1

Please sign in to comment.