Skip to content

Commit

Permalink
fix(pickeryear): Emphasize the current year
Browse files Browse the repository at this point in the history
  • Loading branch information
mst101 committed Jan 23, 2022
1 parent 5e0a7c1 commit fbb29f6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/PickerYear.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ export default {
d.getHours(),
d.getMinutes(),
)
const todayYear = new Date(
this.utils.setDate(this.utils.getNewDateObject(), 1),
)
const todayYear = this.utils.getFullYear(this.utils.getNewDateObject())
for (let i = 0; i < this.yearRange; i += 1) {
years.push({
Expand All @@ -101,7 +99,7 @@ export default {
isDisabled: this.isDisabledYear(dObj),
isOpenDate: this.isOpenYear(dObj),
isSelected: this.isSelectedYear(dObj),
isToday: this.utils.compareDates(dObj, todayYear),
isToday: dObj.getFullYear() === todayYear,
})
this.utils.setFullYear(dObj, this.utils.getFullYear(dObj) + 1)
}
Expand Down

0 comments on commit fbb29f6

Please sign in to comment.