From 87f650f72130d4f4c6ca2b51342a49010de2dbcd Mon Sep 17 00:00:00 2001 From: Mario Juarez Date: Sun, 14 Oct 2018 00:39:43 +0200 Subject: [PATCH] Fix code style --- src/DatetimeYearPicker.vue | 11 ++++++----- src/util.js | 9 +++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/DatetimeYearPicker.vue b/src/DatetimeYearPicker.vue index 7174bde..43ee1ea 100644 --- a/src/DatetimeYearPicker.vue +++ b/src/DatetimeYearPicker.vue @@ -1,10 +1,8 @@ @@ -41,7 +39,10 @@ export default { methods: { select (year) { - if (year.disabled) return + if (year.disabled) { + return + } + this.$emit('change', parseInt(year.number)) }, diff --git a/src/util.js b/src/util.js index 3c03978..a129e6f 100644 --- a/src/util.js +++ b/src/util.js @@ -41,10 +41,11 @@ export function monthDayIsDisabled (minDate, maxDate, year, month, day) { } export function yearIsDisabled (minDate, maxDate, year) { - minDate = minDate ? minDate.year : null - maxDate = maxDate ? maxDate.year : null - return (minDate && year < minDate) || - (maxDate && year > maxDate) + const minYear = minDate ? minDate.year : null + const maxYear = maxDate ? maxDate.year : null + + return (minYear && year < minYear) || + (maxYear && year > maxYear) } export function timeComponentIsDisabled (min, max, component) {