Fixed date range functions.
Build and Test App / Build-and-test-App (push) Successful in 34s Details

This commit is contained in:
Andrew Lalis 2025-09-29 16:18:09 -04:00
parent 6681527b21
commit 7803cb741b
1 changed files with 2 additions and 3 deletions

View File

@ -133,8 +133,7 @@ async function showThisWeek() {
const today = new Date()
today.setHours(0, 0, 0, 0)
// First set the to-date to the next upcoming end-of-week (Friday).
toDate.value = new Date()
toDate.value.setHours(0, 0, 0, 0)
toDate.value = new Date(today)
if (today.getDay() >= 1 && today.getDay() <= 5) {
// If we're anywhere in the week, shift up to Friday.
const dayDiff = 5 - today.getDay()
@ -149,7 +148,7 @@ async function showThisWeek() {
}
// Then set the from-date to the Monday of that week.
fromDate.value = new Date()
fromDate.value = new Date(today)
fromDate.value.setHours(0, 0, 0, 0)
fromDate.value.setDate(toDate.value.getDate() - 4)
await loadEntries()