2 Commits

Author SHA1 Message Date
28f5c43349 fix: improve date comparison for chore completion status
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m16s
2026-04-29 14:18:23 -04:00
a2b464af7b fix: improve date comparison for chore completion status
Some checks failed
Chore App Build, Test, and Push Docker Images / build-and-push (push) Has been cancelled
2026-04-29 14:17:40 -04:00
3 changed files with 15 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
# file: config/version.py
import os
BASE_VERSION = "1.0.11" # update manually when releasing features
BASE_VERSION = "1.0.12" # update manually when releasing features
def get_full_version() -> str:
"""

View File

@@ -224,9 +224,13 @@ const triggerTask = async (task: ChildTask) => {
function isChoreCompletedToday(item: ChildTask): boolean {
if (item.pending_status !== 'approved' || !item.approved_at) return false
const approvedDate = item.approved_at.substring(0, 10)
const today = new Date().toISOString().slice(0, 10)
return approvedDate === today
const approvedDate = new Date(item.approved_at)
const today = new Date()
return (
approvedDate.getFullYear() === today.getFullYear() &&
approvedDate.getMonth() === today.getMonth() &&
approvedDate.getDate() === today.getDate()
)
}
async function doConfirmChore() {

View File

@@ -300,8 +300,13 @@ 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)
if (item.approved_at.slice(0, 10) !== today) return false
const approvedDate = new Date(item.approved_at)
const today = new Date()
const sameDay =
approvedDate.getFullYear() === today.getFullYear() &&
approvedDate.getMonth() === today.getMonth() &&
approvedDate.getDate() === today.getDate()
if (!sameDay) 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