Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/Datepicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
:mondayFirst="mondayFirst"
:dayCellContent="dayCellContent"
:use-utc="useUtc"
:transformCurrYearName="transformCurrYearName"
@changedMonth="handleChangedMonthFromDayPicker"
@selectDate="selectDate"
@showMonthCalendar="showMonthCalendar"
Expand Down Expand Up @@ -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()
Expand Down
6 changes: 4 additions & 2 deletions src/components/PickerDay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export default {
translation: Object,
isRtl: Boolean,
mondayFirst: Boolean,
useUtc: Boolean
useUtc: Boolean,
transformCurrYearName: Function
},
data () {
const constructedDateUtils = makeDateUtils(this.useUtc)
Expand Down Expand Up @@ -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?
Expand Down