tududi/docs
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
..
00-tasks-behavior.md Add LLM docs 2026-03-15 09:01:38 +02:00
01-recurring-tasks-behavior.md Add LLM docs 2026-03-15 09:01:38 +02:00
02-today-page-sections.md Add LLM docs 2026-03-15 09:01:38 +02:00
03-upcoming-view.md Add LLM docs 2026-03-15 09:01:38 +02:00
04-inbox-page.md Add LLM docs 2026-03-15 09:01:38 +02:00
05-notes-system.md Add LLM docs 2026-03-15 09:01:38 +02:00
06-projects.md Add LLM docs 2026-03-15 09:01:38 +02:00
07-areas.md Add LLM docs 2026-03-15 09:01:38 +02:00
08-user-management.md Add LLM docs 2026-03-15 09:01:38 +02:00
08-views-system.md Add LLM docs 2026-03-15 09:01:38 +02:00
09-tags-system.md docs: clarify tag validation rules and Inbox hashtag syntax (#964) 2026-03-26 17:46:43 +02:00
architecture.md Add LLM docs 2026-03-15 09:01:38 +02:00
backend-patterns.md Add comprehensive LLM development documentation (#939) 2026-03-14 02:54:59 +02:00
backups.md Add LLM docs 2026-03-15 09:01:38 +02:00
code-conventions.md Add comprehensive LLM development documentation (#939) 2026-03-14 02:54:59 +02:00
common-tasks.md Add comprehensive LLM development documentation (#939) 2026-03-14 02:54:59 +02:00
database.md Add db layout 2026-03-15 09:07:21 +02:00
development-workflow.md Add comprehensive LLM development documentation (#939) 2026-03-14 02:54:59 +02:00
directory-structure.md Add comprehensive LLM development documentation (#939) 2026-03-14 02:54:59 +02:00
MEMORY.md Fix: Bi-weekly recurring task scheduling for multi-day patterns (#1005) 2026-04-12 08:52:13 +03:00
testing.md Add comprehensive LLM development documentation (#939) 2026-03-14 02:54:59 +02:00