diff --git a/src/components/Datepicker.vue b/src/components/Datepicker.vue index 67055bef..34389472 100644 --- a/src/components/Datepicker.vue +++ b/src/components/Datepicker.vue @@ -48,6 +48,7 @@ :mondayFirst="mondayFirst" :dayCellContent="dayCellContent" :use-utc="useUtc" + :transformCurrYearName="transformCurrYearName" @changedMonth="handleChangedMonthFromDayPicker" @selectDate="selectDate" @showMonthCalendar="showMonthCalendar" @@ -153,7 +154,8 @@ export default { maximumView: { type: String, default: 'year' - } + }, + transformCurrYearName: { type: Function } }, data () { const startDate = this.openDate ? new Date(this.openDate) : new Date() diff --git a/src/components/PickerDay.vue b/src/components/PickerDay.vue index 819d0633..5253e14f 100644 --- a/src/components/PickerDay.vue +++ b/src/components/PickerDay.vue @@ -47,7 +47,8 @@ export default { translation: Object, isRtl: Boolean, mondayFirst: Boolean, - useUtc: Boolean + useUtc: Boolean, + transformCurrYearName: Function }, data () { const constructedDateUtils = makeDateUtils(this.useUtc) @@ -126,7 +127,8 @@ export default { */ currYearName () { const yearSuffix = this.translation.yearSuffix - return `${this.utils.getFullYear(this.pageDate)}${yearSuffix}` + const fy = this.utils.getFullYear(this.pageDate) + return this.transformCurrYearName ? this.transformCurrYearName(fy) : `${fy}${yearSuffix}` }, /** * Is this translation using year/month/day format?