tududi/backend/modules
Chris 01a84c3598
Fix: Bi-weekly recurring task scheduling for multi-day patterns (#1005)
* fix: correct bi-weekly recurring task scheduling for multi-day patterns

Fixes #1004

Previously, when a recurring task was set to repeat every N weeks (where N > 1)
on multiple weekdays that span a week boundary (e.g., Saturday + Sunday), the
algorithm incorrectly calculated the next occurrence dates.

The issue was in the calculateWeeklyRecurrence function, which didn't properly
determine when to add the interval skip for multi-weekday patterns. It would:
- Correctly handle Sat -> Sun (adjacent days, same cycle)
- Incorrectly handle Sun -> Sat (should skip weeks, but didn't)

This fix improves the logic to:
1. Detect when the current day is the last weekday in the pattern cycle
2. Account for Sunday (day 0) wrapping around in the day-of-week numbering
3. Only add interval skips when truly moving to a new cycle, not when moving
   between weekdays within the same cycle

Test coverage added for:
- Bi-weekly Saturday + Sunday pattern (the reported bug)
- Starting from different days in the pattern
- Bi-weekly Tuesday + Thursday pattern
- Tri-weekly Friday + Saturday + Sunday pattern

* docs: update MEMORY.md with GitHub template requirements

- Add detailed PR template requirements and structure
- Expand bug report template requirements with all fields
- Update last modified date
2026-04-12 08:52:13 +03:00
..
admin Fix admin password update silently failing due to Sequelize VIRTUAL field (#893) 2026-03-03 15:44:41 +02:00
areas Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
auth Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
backup Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
feature-flags feat: Add MCP Integration with client-agnostic instructions (#953) 2026-03-20 16:55:49 +02:00
habits Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
inbox Add URL detection to inbox processing service (#942) 2026-03-14 08:43:41 +02:00
mcp feat: Add MCP Integration with client-agnostic instructions (#953) 2026-03-20 16:55:49 +02:00
notes Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
notifications Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
projects Fix project update API to support clearing nullable fields (#961) 2026-03-22 22:17:23 +02:00
quotes Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
search Show original task names for recurring tasks in search results (#914) (#915) 2026-03-06 08:57:10 +02:00
shares Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
tags Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
tasks Fix: Bi-weekly recurring task scheduling for multi-day patterns (#1005) 2026-04-12 08:52:13 +03:00
telegram Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
url Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
users Fix isEmail validation failure on valid emails during Docker setup (#835) 2026-02-11 15:42:11 +02:00
views Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00