From 9ee7afc1c55fa718650f2111848e8763792c3238 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Tue, 3 Jan 2017 18:52:44 +0800 Subject: [PATCH] TimeSelect: fix maxTime range, fixed #2158 --- packages/date-picker/src/panel/time-select.vue | 2 +- test/unit/specs/time-select.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/date-picker/src/panel/time-select.vue b/packages/date-picker/src/panel/time-select.vue index bc0fa068..dd450acd 100644 --- a/packages/date-picker/src/panel/time-select.vue +++ b/packages/date-picker/src/panel/time-select.vue @@ -124,7 +124,7 @@ result.push({ value: current, disabled: compareTime(current, this.minTime || '-1:-1') <= 0 || - compareTime(current, this.maxTime || '100:100') > 0 + compareTime(current, this.maxTime || '100:100') >= 0 }); current = nextTime(current, step); } diff --git a/test/unit/specs/time-select.spec.js b/test/unit/specs/time-select.spec.js index ee500f45..88eb71c4 100644 --- a/test/unit/specs/time-select.spec.js +++ b/test/unit/specs/time-select.spec.js @@ -160,7 +160,7 @@ describe('TimeSelect', () => { setTimeout(_ => { const elm = picker.picker.$el.querySelector('.disabled'); - expect(elm.textContent).to.equal('15:00'); + expect(elm.textContent).to.equal('14:30'); destroyVM(vm); done(); }, 50);