tududi/backend/modules/tasks/core
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
..
builders.js Fix initial due date calculation for weekly tasks with multiple weekdays (#974) (#975) 2026-03-26 17:19:59 +02:00
comparators.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
parsers.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
serializers.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00