pass test

find other bug and fixed it-
pull/2950/head^2
Diamond 2017-02-18 10:24:47 +08:00 committed by 杨奕
parent 87b842cfa3
commit 1b8657ce0d
4 changed files with 8 additions and 15 deletions

View File

@ -80,22 +80,11 @@
}, },
watch: { watch: {
hours(newVal) {
this.ajustElTop('hour', newVal);
},
minutes(newVal) {
this.ajustElTop('minute', newVal);
},
seconds(newVal) {
this.ajustElTop('second', newVal);
},
hoursPrivate(newVal, oldVal) { hoursPrivate(newVal, oldVal) {
if (!(newVal >= 0 && newVal <= 23)) { if (!(newVal >= 0 && newVal <= 23)) {
this.hoursPrivate = oldVal; this.hoursPrivate = oldVal;
} }
this.ajustElTop('hour', newVal);
this.$emit('change', { hours: newVal }); this.$emit('change', { hours: newVal });
}, },
@ -103,6 +92,7 @@
if (!(newVal >= 0 && newVal <= 59)) { if (!(newVal >= 0 && newVal <= 59)) {
this.minutesPrivate = oldVal; this.minutesPrivate = oldVal;
} }
this.ajustElTop('minute', newVal);
this.$emit('change', { minutes: newVal }); this.$emit('change', { minutes: newVal });
}, },
@ -110,7 +100,7 @@
if (!(newVal >= 0 && newVal <= 59)) { if (!(newVal >= 0 && newVal <= 59)) {
this.secondsPrivate = oldVal; this.secondsPrivate = oldVal;
} }
this.ajustElTop('second', newVal);
this.$emit('change', { seconds: newVal }); this.$emit('change', { seconds: newVal });
} }
}, },

View File

@ -150,6 +150,9 @@
handleChange() { handleChange() {
if (this.minTime > this.maxTime) return; if (this.minTime > this.maxTime) return;
MIN_TIME.setFullYear(this.minTime.getFullYear());
MIN_TIME.setMonth(this.minTime.getMonth());
MIN_TIME.setDate(this.minTime.getDate());
this.$refs.minSpinner.selectableRange = [[MIN_TIME, this.maxTime]]; this.$refs.minSpinner.selectableRange = [[MIN_TIME, this.maxTime]];
this.$refs.maxSpinner.selectableRange = [[this.minTime, MAX_TIME]]; this.$refs.maxSpinner.selectableRange = [[this.minTime, MAX_TIME]];
this.handleConfirm(true); this.handleConfirm(true);

View File

@ -448,7 +448,7 @@ export default {
this.picker.$on('dodestroy', this.doDestroy); this.picker.$on('dodestroy', this.doDestroy);
this.picker.$on('pick', (date, visible = false) => { this.picker.$on('pick', (date, visible = false) => {
if (this.dateChanged(date, this.value)) this.$emit('input', date); this.$emit('input', date);
this.pickerVisible = this.picker.visible = visible; this.pickerVisible = this.picker.visible = visible;
this.picker.resetView && this.picker.resetView(); this.picker.resetView && this.picker.resetView();
}); });

View File

@ -145,7 +145,7 @@ export const limitRange = function(date, ranges) {
if (!ranges || !ranges.length) return date; if (!ranges || !ranges.length) return date;
const len = ranges.length; const len = ranges.length;
const format = 'HH:mm:ss'; const format = 'yyyy-MM-dd HH:mm:ss';
date = dateUtil.parse(dateUtil.format(date, format), format); date = dateUtil.parse(dateUtil.format(date, format), format);
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {