Refactor code structure for improved readability and maintainability
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 3m27s

This commit is contained in:
2026-04-13 10:27:30 -04:00
parent 759a1c745e
commit 876d3c5531
9 changed files with 147 additions and 68 deletions

View File

@@ -301,7 +301,10 @@ function handleChoreConfirmation(event: Event) {
function isChoreCompletedToday(item: ChildTask): boolean {
if (item.pending_status !== 'approved' || !item.approved_at) return false
const today = new Date().toISOString().slice(0, 10)
return item.approved_at.slice(0, 10) === today
if (item.approved_at.slice(0, 10) !== today) return false
// If the task has a schedule and today is not a scheduled day, don't show as completed
if (item.schedule && !isScheduledToday(item.schedule, new Date())) return false
return true
}
function isChorePending(item: ChildTask): boolean {