* Fix recurring task initial due date calculation to match recurrence pattern Resolves #963 When creating a recurring task without an explicit due date, the system was incorrectly setting it to "today" regardless of the recurrence pattern. This caused issues where: - Monthly tasks set to recur on a specific day (e.g., 28th) would show the wrong due date (today/yesterday instead of the 28th) - Tasks wouldn't appear correctly in the Upcoming view - The base due_date didn't match the recurrence_month_day setting Changes: - Add calculateInitialDueDate() helper to compute correct first occurrence - For monthly recurrence with specific day: calculate next occurrence of that day - For weekly recurrence with specific weekday: calculate next occurrence of that weekday - For other types (daily, etc.): maintain current behavior (use today) - Apply same logic to both task creation and updates Tests: - Add comprehensive test suite (9 new tests) covering: - Monthly recurrence with future day in current month - Monthly recurrence with past day (should use next month) - Weekly recurrence with specific weekday - Daily recurrence (should still default to today) - Edge cases (31st of month, explicitly provided dates) - Task updates adding recurrence All 54 recurring task tests pass. * Fix UTC timezone bug in recurring task expansion and add comprehensive tests - Fix expandRecurringTasks() to use setUTCHours instead of setHours - Add 42 unit tests for recurringTaskService UTC consistency - Add 24 DST transition tests (spring forward/fall back) - Verify no occurrence skips or duplicates during DST - Test month-end handling, leap years, and timezone boundaries |
||
|---|---|---|
| .. | ||
| helpers | ||
| integration | ||
| mocks | ||
| unit | ||