Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
mariomka committed Oct 13, 2018
1 parent 3fcf121 commit 87f650f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/DatetimeYearPicker.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<template>
<div class="vdatetime-year-picker">
<div class="vdatetime-year-picker__list vdatetime-year-picker__list" ref="yearList">
<div class="vdatetime-year-picker__item" v-for="year in years" @click="select(year)" :class="{
'vdatetime-year-picker__item--selected': year.selected,
'vdatetime-year-picker__item--disabled': year.disabled
}">{{ year.number }}</div>
<div class="vdatetime-year-picker__item" v-for="year in years" @click="select(year)" :class="{'vdatetime-year-picker__item--selected': year.selected, 'vdatetime-year-picker__item--disabled': year.disabled}">{{ year.number }}
</div>
</div>
</div>
</template>
Expand Down Expand Up @@ -41,7 +39,10 @@ export default {
methods: {
select (year) {
if (year.disabled) return
if (year.disabled) {
return
}
this.$emit('change', parseInt(year.number))
},
Expand Down
9 changes: 5 additions & 4 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 87f650f

Please sign in to comment.