update TimePicker

update TimePicker
This commit is contained in:
梁灏 2016-12-29 09:54:29 +08:00
parent a18d2b3a8a
commit 964582b399
2 changed files with 12 additions and 2 deletions

View file

@ -144,7 +144,17 @@
this.dateEnd.setSeconds(dateEnd.seconds);
this.secondsEnd = this.dateEnd.getSeconds();
}
if (emit) this.$emit('on-pick', [this.date, this.dateEnd], true);
// judge endTime > startTime?
if (this.dateEnd < this.date) {
this.$nextTick(() => {
this.dateEnd = new Date(this.date);
this.hoursEnd = this.dateEnd.getHours();
this.minutesEnd = this.dateEnd.getMinutes();
this.secondsEnd = this.dateEnd.getSeconds();
});
} else {
if (emit) this.$emit('on-pick', [this.date, this.dateEnd], true);
}
},
handleStartChange (date) {
this.handleChange(date, {});

View file

@ -51,7 +51,7 @@
methods: {
c (s) {
// console.log(1,s);
console.log(s);
// this.value2 = s;
},
ok () {