Skip to content

Commit 621a929

Browse files
committed
fix: organize setters and getters
1 parent f64c702 commit 621a929

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

src/components/Calendar/components/DayComposer/components/DayButton/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ DayButton.prototype = Object.assign(DayButton.prototype, Component.prototype, {
5151
this.$dayButton.classList.remove('day__button--active');
5252
},
5353

54-
actualDay() {
54+
currentDay() {
5555
this.$dayButton.classList.add('day__button--actual');
5656
},
5757
});

src/components/Calendar/components/DayComposer/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function DayComposer({
2222
this.$dayComposer = this.selected.get('day-composer');
2323
this.activeDayButton = null;
2424

25-
const actualDay = dayjs().date();
25+
const currentDay = dayjs().date();
2626
const actualMonth = dayjs().month() + 1;
2727
const actualYear = dayjs().year();
2828

@@ -50,11 +50,11 @@ export default function DayComposer({
5050
);
5151

5252
if (
53-
this.actualMonthDay === actualDay &&
53+
this.actualMonthDay === currentDay &&
5454
this.month === actualMonth &&
5555
this.year === actualYear
5656
)
57-
this.dayButton.actualDay();
57+
this.dayButton.currentDay();
5858

5959
this.actualMonthDay += 1;
6060
}

src/components/Calendar/index.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -89,43 +89,43 @@ Calendar.prototype = Object.assign(Calendar.prototype, Component.prototype, {
8989
});
9090
},
9191

92-
getDate() {
93-
return {
94-
day: this.day,
95-
month: this.month,
96-
year: this.year,
97-
};
98-
},
99-
10092
setDay(day) {
10193
this.day = day;
10294
this.setDate(this.day, this.month, this.year);
10395

10496
this.emit('day:change', this.day);
10597
},
10698

107-
getDay() {
108-
return this.day;
109-
},
110-
11199
setMonth(month) {
112100
this.month = month;
113101
this.setDate(this.day, this.month, this.year);
114102

115103
this.emit('month:change', this.month);
116104
},
117105

118-
getMonth() {
119-
return this.month;
120-
},
121-
122106
setYear(year) {
123107
this.year = year;
124108
this.setDate(this.day, this.month, this.year);
125109

126110
this.emit('year:change', this.year);
127111
},
128112

113+
getDate() {
114+
return {
115+
day: this.day,
116+
month: this.month,
117+
year: this.year,
118+
};
119+
},
120+
121+
getDay() {
122+
return this.day;
123+
},
124+
125+
getMonth() {
126+
return this.month;
127+
},
128+
129129
getYear() {
130130
return this.year;
131131
},

0 commit comments

Comments
 (0)