[02]Practice
Holiday optimiser
In ProgressPlans annual leave around weekends and public holidays to get the most days off.
StatusIn Progress
TypePractice
Updated
Stack
reacttypescriptvitest
About
leave.opt takes a region, a year and a leave allowance, then works out which days to book so each one sits next to a weekend or public holiday and turns into the most time off. Five strategies trade off break count, break length and efficiency.
01Approach
- →Public holidays are calculated, not fetched: fixed dates, nth-weekday rules, Easter-relative feasts, and each region's weekend substitution rules (UK/CA/AU move forward, the US observes on the nearest weekday).
- →The optimiser is a knapsack-style dynamic programme over the year's days. Candidate breaks are runs bounded by workdays that bridge at least one day off, and each strategy is just a different score for a break.
- →Both live in pure modules (holidays.ts, optimizer.ts) under src/features/holiday-optimiser/, tested on their own before the UI.
02What it does
- →Regions: England & Wales, Scotland, US federal, Canada, Australia, Germany
- →Years 2026 and 2027, allowance 0–60 days
- →Strategies: balanced, many short breaks, few long breaks, best value, efficiency per break
- →A summary (leave days → days off), a table of breaks, and a year calendar. Hovering a break in either one highlights it in both.
03What's next
- →Regional holidays (German states, Australian states, Canadian provinces)
- →Let people mark days they can't take off
Live app
/app-holiday-optimiser/