fix: date

This commit is contained in:
Dustella 2025-02-14 13:59:54 +08:00
parent 80c74b338b
commit 5db8c5a79b
Signed by: Dustella
GPG Key ID: 35AA0AA3DC402D5C
2 changed files with 9 additions and 6 deletions

3
.gitignore vendored
View File

@ -4,4 +4,5 @@ dist
.env
.env*
!.env.example
.vite-ssg-temp
.vite-ssg-temp
dist*

View File

@ -52,9 +52,7 @@ function _useOptions() {
// check if Target date is later than begin date
// if so, set target date to begin date
if (castTargetDate.value) {
if (castTargetDate.value.compare(date) < 0) {
castTargetDate.value = date.add({ days: 1 })
}
castTargetDate.value = date.add({ days: 1 })
}
}
@ -120,12 +118,16 @@ function _useOptions() {
}
}
}
watch(castBeginDate, () => {
if (castBeginDate.value) {
setCastBeginDate(castBeginDate.value)
}
})
watch([castBeginDate, castTargetDate], () => {
watch(castTargetDate, () => {
if (!castBeginDate.value || !castTargetDate.value) {
return
}
setCastBeginDate(castBeginDate.value)
setTargetDate(castTargetDate.value)
refreshCurrentTcLoc()
})