feat: Refactor ScheduleModal to support interval scheduling with date input and deadline toggle
Some checks failed
Chore App Build, Test, and Push Docker Images / build-and-push (push) Failing after 2m30s

- Updated ChoreSchedule model to include anchor_date and interval_has_deadline.
- Refactored interval scheduling logic in scheduleUtils to use anchor_date.
- Introduced DateInputField component for selecting anchor dates in ScheduleModal.
- Enhanced ScheduleModal to include a stepper for interval days and a toggle for deadline.
- Updated tests for ScheduleModal and scheduleUtils to reflect new interval scheduling logic.
- Added DateInputField tests to ensure proper functionality and prop handling.
This commit is contained in:
2026-02-26 15:16:46 -05:00
parent 2403daa3f7
commit a197f8e206
12 changed files with 797 additions and 172 deletions

View File

@@ -37,8 +37,9 @@ class ChoreSchedule(BaseModel):
default_minute: int = 0 # master deadline minute for 'days' mode
# mode='interval' fields
interval_days: int = 2 # 27
anchor_weekday: int = 0 # 0=Sun6=Sat
interval_days: int = 2 # 17
anchor_date: str = "" # ISO date string e.g. "2026-02-25"; "" = use today
interval_has_deadline: bool = True # False = "Anytime" (no deadline)
interval_hour: int = 0
interval_minute: int = 0
@@ -52,7 +53,8 @@ class ChoreSchedule(BaseModel):
default_hour=d.get('default_hour', 8),
default_minute=d.get('default_minute', 0),
interval_days=d.get('interval_days', 2),
anchor_weekday=d.get('anchor_weekday', 0),
anchor_date=d.get('anchor_date', ''),
interval_has_deadline=d.get('interval_has_deadline', True),
interval_hour=d.get('interval_hour', 0),
interval_minute=d.get('interval_minute', 0),
id=d.get('id'),
@@ -70,7 +72,8 @@ class ChoreSchedule(BaseModel):
'default_hour': self.default_hour,
'default_minute': self.default_minute,
'interval_days': self.interval_days,
'anchor_weekday': self.anchor_weekday,
'anchor_date': self.anchor_date,
'interval_has_deadline': self.interval_has_deadline,
'interval_hour': self.interval_hour,
'interval_minute': self.interval_minute,
})