fix: 选择时间起始不正确的问题

This commit is contained in:
kuaifan 2024-10-22 21:32:58 +08:00
parent e2e7bc8d72
commit 4dfa1c8efc
2 changed files with 2 additions and 2 deletions

View File

@ -395,7 +395,7 @@ export default {
async taskTimeChange(data) { async taskTimeChange(data) {
const times = $A.newDateString(data.times, "YYYY-MM-DD HH:mm"); const times = $A.newDateString(data.times, "YYYY-MM-DD HH:mm");
if ($A.rightExists(times[0], '00:00') && $A.rightExists(times[1], '23:59')) { if (/\s+(00:00|23:59)$/.test(times[0]) && /\s+(00:00|23:59)$/.test(times[1])) {
this.$set(data, 'times', await this.$store.dispatch("taskDefaultTime", times)) this.$set(data, 'times', await this.$store.dispatch("taskDefaultTime", times))
} }
}, },

View File

@ -1205,7 +1205,7 @@ export default {
async taskTimeChange() { async taskTimeChange() {
const times = $A.newDateString(this.timeValue, "YYYY-MM-DD HH:mm"); const times = $A.newDateString(this.timeValue, "YYYY-MM-DD HH:mm");
if ($A.rightExists(times[0], '00:00') && $A.rightExists(times[1], '23:59')) { if (/\s+(00:00|23:59)$/.test(times[0]) && /\s+(00:00|23:59)$/.test(times[1])) {
this.timeValue = await this.$store.dispatch("taskDefaultTime", times) this.timeValue = await this.$store.dispatch("taskDefaultTime", times)
} }
}, },