Skip to content

Commit

Permalink
feature(uiComponents) ergonode#70 Code improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejkaczorowski committed Jul 22, 2019
1 parent 2a51329 commit da87b32
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
10 changes: 6 additions & 4 deletions components/Inputs/Date/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ export default {
onPreviousDate() {
switch (this.selectedCalendarType) {
case CalendarType.DAY: {
const { month, year } = getPreviousMonth(this.month, this.year);
const {
month: previousMonth, year: previousYear,
} = getPreviousMonth(this.month, this.year);
this.month = month;
this.year = year;
this.calendarHeader = getHeaderForCalendarDaysType(month, year);
this.month = previousMonth;
this.year = previousYear;
this.calendarHeader = getHeaderForCalendarDaysType(previousMonth, previousYear);
break;
}
Expand Down
2 changes: 0 additions & 2 deletions components/Inputs/Date/DatePickerCalendarContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ export default {
if (date.getFullYear() === this.year) {
return this.months[date.getMonth()];
}
return '';
}
return '';
Expand Down
6 changes: 0 additions & 6 deletions components/Inputs/Date/DatePickerMonthDays.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ export default {
};
},
methods: {
onMouseOver() {
},
onMouseOut() {
},
onSelectDate(date) {
this.$emit('select', { ...date });
},
Expand Down
8 changes: 5 additions & 3 deletions components/Inputs/Date/DateRangePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,12 @@ export default {
return Object.keys(CALENDAR_MONTHS)[Math.max(0, Math.min(month - 1, 11))];
},
previousMonth() {
const { month, year } = getPreviousMonth(this.lowerBoundMonth, this.lowerBoundYear);
const {
month: previousMonth, year: previousYear,
} = getPreviousMonth(this.lowerBoundMonth, this.lowerBoundYear);
this.lowerBoundMonth = month;
this.lowerBoundYear = year;
this.lowerBoundMonth = previousMonth;
this.lowerBoundYear = previousYear;
this.upperBoundMonth = this.upperBoundMonth > 1
? this.upperBoundMonth - 1
: 12;
Expand Down

0 comments on commit da87b32

Please sign in to comment.