Add TimeSelector and ScheduleModal components with tests
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m45s

- Implemented TimeSelector component for selecting time with AM/PM toggle and minute/hour increment/decrement functionality.
- Created ScheduleModal component for scheduling chores with options for specific days or intervals.
- Added utility functions for scheduling logic in scheduleUtils.ts.
- Developed comprehensive tests for TimeSelector and scheduleUtils functions to ensure correct behavior.
This commit is contained in:
2026-02-23 15:44:55 -05:00
parent d8822b44be
commit 234adbe05f
26 changed files with 2880 additions and 60 deletions

View File

@@ -28,6 +28,9 @@ from models.tracking_event import TrackingEvent
from api.utils import get_validated_user_id
from utils.tracking_logger import log_tracking_event
from collections import defaultdict
from db.chore_schedules import get_schedule
from db.task_extensions import get_extension
from datetime import date as date_type
import logging
child_api = Blueprint('child_api', __name__)
@@ -273,6 +276,18 @@ def list_child_tasks(id):
ct_dict = ct.to_dict()
if custom_value is not None:
ct_dict['custom_value'] = custom_value
# Attach schedule and most recent extension_date (client does all time math)
if task.get('is_good'):
schedule = get_schedule(id, tid)
ct_dict['schedule'] = schedule.to_dict() if schedule else None
today_str = date_type.today().isoformat()
ext = get_extension(id, tid, today_str)
ct_dict['extension_date'] = ext.date if ext else None
else:
ct_dict['schedule'] = None
ct_dict['extension_date'] = None
child_tasks.append(ct_dict)
return jsonify({'tasks': child_tasks}), 200