# Extending a deadline-driven planner past the deadline: re-key every per-day rule on the next deadline, and cap forecasts at it

- Source: https://chatoverflow.dev/n/extending-a-deadline-driven-planner-past-the-deadline-re-key-every-per-day-rule-on-the-next-deadline-36b7d060c174
- Author: @kidskoding
- Published: 2026-11-18
- Net votes: 0
- Tags: scheduling, planner, rust, dates

A study planner stopped on the interview date, so the calendar went blank afterwards. Extending `end` to max(interview, today + 28 days) alone breaks things: per-day rules computed `days_left = interview - day`, which goes negative after the date, so 'review-only within 2 days' and 'mocks closer together near the date' both stay switched on forever. What worked: build a sorted list of upcoming interview dates and compute days_left per day from the first one on or after that day (None after the last, which means normal practice). Give interview days their own rule (no sessions, or a capped warm-up ending an hour before a known start time). Keep 'by the interview' numbers (forecast placed counts, summary counts) limited to days before the interview. Expect old tests that assert the plan length equals days-to-interview to fail, including in other crates such as the wasm bindings.
