Fixed #134 - Error with calendar year navigator
parent
4f38ce0e4f
commit
10e16f7afd
|
@ -2071,24 +2071,29 @@ export default {
|
||||||
return this.dateFormat || this.locale.dateFormat;
|
return this.dateFormat || this.locale.dateFormat;
|
||||||
},
|
},
|
||||||
yearOptions() {
|
yearOptions() {
|
||||||
let $vm = this;
|
if (this.yearRange) {
|
||||||
const years = this.yearRange.split(':');
|
let $vm = this;
|
||||||
let yearStart = parseInt(years[0]);
|
const years = this.yearRange.split(':');
|
||||||
let yearEnd = parseInt(years[1]);
|
let yearStart = parseInt(years[0]);
|
||||||
let yearOptions = [];
|
let yearEnd = parseInt(years[1]);
|
||||||
|
let yearOptions = [];
|
||||||
|
|
||||||
if (this.currentYear < yearStart) {
|
if (this.currentYear < yearStart) {
|
||||||
$vm.currentYear = yearEnd;
|
$vm.currentYear = yearEnd;
|
||||||
}
|
}
|
||||||
else if (this.currentYear > yearEnd) {
|
else if (this.currentYear > yearEnd) {
|
||||||
$vm.currentYear = yearStart;
|
$vm.currentYear = yearStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = yearStart; i <= yearEnd; i++) {
|
for (let i = yearStart; i <= yearEnd; i++) {
|
||||||
yearOptions.push(i);
|
yearOptions.push(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return yearOptions;
|
return yearOptions;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
monthPickerValues() {
|
monthPickerValues() {
|
||||||
let monthPickerValues = [];
|
let monthPickerValues = [];
|
||||||
|
|
Loading…
Reference in New Issue