Fixed date range functions.
Build and Test App / Build-and-test-App (push) Successful in 34s
Details
Build and Test App / Build-and-test-App (push) Successful in 34s
Details
This commit is contained in:
parent
6681527b21
commit
7803cb741b
|
@ -133,8 +133,7 @@ async function showThisWeek() {
|
||||||
const today = new Date()
|
const today = new Date()
|
||||||
today.setHours(0, 0, 0, 0)
|
today.setHours(0, 0, 0, 0)
|
||||||
// First set the to-date to the next upcoming end-of-week (Friday).
|
// First set the to-date to the next upcoming end-of-week (Friday).
|
||||||
toDate.value = new Date()
|
toDate.value = new Date(today)
|
||||||
toDate.value.setHours(0, 0, 0, 0)
|
|
||||||
if (today.getDay() >= 1 && today.getDay() <= 5) {
|
if (today.getDay() >= 1 && today.getDay() <= 5) {
|
||||||
// If we're anywhere in the week, shift up to Friday.
|
// If we're anywhere in the week, shift up to Friday.
|
||||||
const dayDiff = 5 - today.getDay()
|
const dayDiff = 5 - today.getDay()
|
||||||
|
@ -149,7 +148,7 @@ async function showThisWeek() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then set the from-date to the Monday of that week.
|
// 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.setHours(0, 0, 0, 0)
|
||||||
fromDate.value.setDate(toDate.value.getDate() - 4)
|
fromDate.value.setDate(toDate.value.getDate() - 4)
|
||||||
await loadEntries()
|
await loadEntries()
|
||||||
|
|
Loading…
Reference in New Issue