fix timepicker error

This commit is contained in:
nokazn 2019-12-12 14:15:39 +00:00
parent 410a5fbca7
commit f0bd71f9a8

View file

@ -532,8 +532,9 @@
const pickerPossibleValues = timePickers[pickerIndex][`${timeParts[col]}List`]; const pickerPossibleValues = timePickers[pickerIndex][`${timeParts[col]}List`];
const nextIndex = pickerPossibleValues.findIndex(({text}) => this.focusedTime.time[pickerIndex][col] === text) + increment; const currentIndex = pickerPossibleValues.findIndex(({text}) => this.focusedTime.time[pickerIndex][col] === text);
const nextValue = pickerPossibleValues[nextIndex % pickerPossibleValues.length].text; const nextIndex = (currentIndex + increment + pickerPossibleValues.length) % pickerPossibleValues.length;
const nextValue = pickerPossibleValues[nextIndex].text;
const times = this.focusedTime.time.map((time, i) => { const times = this.focusedTime.time.map((time, i) => {
if (i !== pickerIndex) return time; if (i !== pickerIndex) return time;
time[col] = nextValue; time[col] = nextValue;