Selaa lähdekoodia

TimeSelect: fix maxTime range, fixed #2158

qingwei.li 8 vuotta sitten
vanhempi
commit
9ee7afc1c5

+ 1 - 1
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);
           }

+ 1 - 1
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);