fix(robustness): parseInt radix, minGapDays null-guard, log silent catches (#14)

- parseInt(month/year) now passes radix 10 consistently.
- minGap eligibility guards null/undefined (c.minGapDays != null && > 0).
- The corrupt-localStorage load and the createEmployee catch now console.warn
  instead of swallowing the error silently.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ferdi2goandClaude Opus 4.8 committed 2026-06-03 13:05:34 +00:00
1 parent fd9870871b
commit 7ab2911c2f
4 files changed
+8 -6

No files matched your search

+1 -1
View File
@@ -37,7 +37,7 @@ function isEligible(employee, isoDate, monthAssignments, allHistory) {
if (count >= c.maxPerMonth) return false;
}
if (c.minGapDays > 0) {
if (c.minGapDays != null && c.minGapDays > 0) {
// Latest prior assignment date for this employee — single pass, no sort/alloc
let lastDate = null;
const isLater = a => a.employeeId === employee.id && a.date < isoDate &&