Skip to content

Commit

Permalink
feature(uiComponents) ergonode#70 Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejkaczorowski committed Jul 22, 2019
1 parent da87b32 commit f74406d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 6 additions & 4 deletions components/Inputs/Date/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,13 @@ export default {
onNextDate() {
switch (this.selectedCalendarType) {
case CalendarType.DAY: {
const { month, year } = getNextMonth(this.month, this.year);
const {
month: nextMonth, year: nextYear,
} = getNextMonth(this.month, this.year);
this.month = month;
this.year = year;
this.calendarHeader = getHeaderForCalendarDaysType(month, year);
this.month = nextMonth;
this.year = nextYear;
this.calendarHeader = getHeaderForCalendarDaysType(nextMonth, nextYear);
break;
}
Expand Down
4 changes: 0 additions & 4 deletions components/Inputs/Date/DatePickerHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
* Copyright © Bold Brand Commerce Sp. z o.o. All rights reserved.
* See LICENSE for license details.
*/
/*
* Copyright © Bold Brand Commerce Sp. z o.o. All rights reserved.
* See LICENSE for license details.
*/
<template>
<div class="header">
<span v-text="header" />
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 @@ -133,10 +133,12 @@ export default {
: this.upperBoundYear;
},
nextMonth() {
const { month, year } = getNextMonth(this.upperBoundMonth, this.upperBoundYear);
const {
month: nextMonth, year: nextYear,
} = getNextMonth(this.upperBoundMonth, this.upperBoundYear);
this.upperBoundMonth = month;
this.upperBoundYear = year;
this.upperBoundMonth = nextMonth;
this.upperBoundYear = nextYear;
this.lowerBoundMonth = this.lowerBoundMonth < 12
? this.lowerBoundMonth + 1
: 1;
Expand Down

0 comments on commit f74406d

Please sign in to comment.