The ISO week-numbering year
The 1-indexed calendar month (1..12)
The 1-indexed calendar day (1..31)
OptionalexpectedDayOfWeek: number
Optional 1-indexed ISO weekday (1=Monday..7=Sunday)
The resolved calendar year, or undefined if invalid or ambiguous
Resolves the calendar year corresponding to an ISO week-numbering year for a specified month and day, testing adjacent calendar-year candidates. Uses expectedDayOfWeek (1=Monday..7=Sunday) to disambiguate when available, and rejects ambiguous dates that match multiple candidate years without weekday disambiguation. Pure integer arithmetic — zero Date allocations.