tududi/backend/modules/tasks
Chris 65b9bbce39
Fix initial due date calculation for weekly tasks with multiple weekdays (#974) (#975)
Fix calculateInitialDueDate() to properly handle recurrence_weekdays array
when creating or updating weekly recurring tasks with multiple weekdays.

Previously, the function only checked for recurrence_weekday (singular) and
ignored recurrence_weekdays (plural array), causing tasks with multiple
weekdays to incorrectly get today's date instead of the next occurrence.

Changes:
- Add support for recurrence_weekdays array in calculateInitialDueDate()
- Fix buildUpdateAttributes() to pass recurrence_weekdays parameter
- Add 8 unit tests covering multiple weekdays scenarios
- Add 3 integration tests for API CREATE and UPDATE operations
- Maintain backward compatibility with single recurrence_weekday

The fix mirrors the proven logic from calculateWeeklyRecurrence() in
recurringTaskService.js and properly handles edge cases like unsorted
arrays, wrapping to next week, and JSON string parsing.

Fixes #974
2026-03-26 17:19:59 +02:00
..
core Fix initial due date calculation for weekly tasks with multiple weekdays (#974) (#975) 2026-03-26 17:19:59 +02:00
middleware Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
operations Fix Today page task completion issues (#970) 2026-03-24 16:45:31 +02:00
queries Fix subtask ordering to prevent random reordering (#930) 2026-03-10 00:17:26 +02:00
utils Fix defer date validation for recurring task instances (#910) 2026-03-05 08:20:30 +02:00
attachments.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
deferredTaskService.js Fix Telegram notification spam with channel-level rate limiting (#951) 2026-03-19 20:26:11 +02:00
dueTaskService.js Fix Telegram notification spam with channel-level rate limiting (#951) 2026-03-19 20:26:11 +02:00
events.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
index.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
recurringTaskService.js Fix bi-weekly+ recurring tasks reverting to weekly (#844) (#890) 2026-03-02 23:36:47 +02:00
repository.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
routes.js Fix Today page task completion issues (#970) 2026-03-24 16:45:31 +02:00
taskEventService.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
taskScheduler.js Fix issue with wrong path 2026-01-18 09:47:12 +02:00
taskSummaryService.js Fix Telegram task display bug by escaping backslashes (#860) 2026-02-24 14:19:45 +02:00