Commit Graph
7 Commits
Author SHA1 Message Date
ferdi2goandClaude Opus 4.8 fd9870871b refactor: centralize shared date/name helpers in utils.js (#12)
New js/utils.js exports toISO, monthPrefix, getWeekday, formatDateDE and
buildNameMap. algorithm.js, calendar.js, excel.js and history.js now import
these instead of re-implementing ISO construction, weekday math, DD.MM.YYYY
formatting and the id→name map inline. Adds tests/utils.test.mjs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 13:01:28 +00:00
ferdi2goandClaude Opus 4.8 c076b5e1ce perf(algorithm): precompute history count, drop per-candidate sort (#9)
- generatePlan computes a histCount Map once; scoreCandidate now does an O(1)
  lookup instead of filtering the whole history per candidate per day.
- minGap eligibility finds the latest prior date in a single pass instead of
  spreading history+monthAssignments into a new array and sorting it.

Behaviour is unchanged (all algorithm tests pass).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 12:44:45 +00:00
ferdi2goandClaude Opus 4.8 e851bb2833 fix(calendar): preserve manual picks when regenerating a month (#2)
generatePlan gains a preAssigned parameter: manual entries occupy slots,
count toward eligibility (maxPerMonth/minGap) and are never double-booked;
only the remaining slots per day are auto-filled. The generate handler now
keeps manual:true entries for the month instead of wiping them.

Adds tests for slot occupation, fully-manual days, and maxPerMonth counting.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 12:17:22 +00:00
ferdi2go 3d314e84fd feat(algo): skip day when candidates < slotsPerDay 2026-04-28 10:07:22 +00:00
ferdi2go 625f9c7037 feat(algo): slotsPerDay parameter for top-N selection 2026-04-28 09:59:44 +00:00
ferdi2go 790ea72987 refactor: generatePlan returns {assignments, skippedDates} 2026-04-28 09:55:25 +00:00
FerdinandandClaude Sonnet 4.6 b5cfe5b336 feat: algorithm module with unit tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 13:10:49 +02:00