© AlastairRunning.com — Training Plan Builder CHANGELOG ============================================================= v2.25 (2026-05-04) - Fixed plan start date and available week count being wrong for non-Sunday races. Root cause: planStartDate() was subtracting weeks×7 from the raw race date, which assumed races always fall on Sunday. For a Friday race (Jul 24), this placed the plan start one week too early — making week 11 land on Jul 13-19 instead of Jul 20-24, and showing Jul 17 as the race date in print cells. Fix: introduced raceMondayDate() which finds the Monday of the race week (race date minus raceDow). All plan length calculations now anchor on this Monday: planStartDate = raceMonday - (weeks-1)×7 weeksAvailable = floor((raceMonday - nextMonday) / 7) + 1 The +1 in weeksAvailable means a race that is exactly N weeks away (measured to its Monday) now correctly yields N as available, rather than N-1. For a May 4 start and Jul 24 Friday race: - raceMonday = Jul 20 - weeksAvailable = 12 (was 11) - 12-week plan starts May 4 with race correctly on Fri Jul 24 - 11-week plan starts May 11 with race correctly on Fri Jul 24 Also fixed earliest selectable date in calendar to use (min-1)×7 instead of min×7, consistent with the corrected week count formula. v2.24 (2026-05-04) - Fixed nextMonday() returning next week when today IS Monday. When dow===1 the function was setting days=7, meaning May 4 was treated as May 11 — dropping one full week from plan lengths. - Print table cells now show calendar date top-right: "May 4th", "Sept 6th" etc. Only shown when a race date is entered. v2.23 (2026-04-23) - Session distances snapped to nearest 0.5 km/mi. - Print descriptions rebalanced to concise but coaching-useful. - Fixed "Trail Marathon" for 30K: threshold ≤20.5mi → ≤21.0mi. - Stat card contrast improved. - Week pill bottom margin and plan output spacing improved. v2.22 (2026-04-23) - Race Name field added. TAK spacing applied to AR. v2.21 (2026-04-23) - Race week built around actual race day of week (raceWeekStruct). v2.20 (2026-04-23) - Gradient caps per session type for trail plans. v2.19 (2026-04-23) - Fixed race week training session elevations (set to 0). - Fixed syncF() missing before setState() calls. v2.18 (2026-04-23) - Trail LR elevation 45%; med-long 30%; nearest 100m rounding. v2.17 (2026-04-23) - Fixed elevation formula ignoring race elevation entirely. v2.16 (2026-03-31) - Race elevation stat card shows actual value. v2.15 (2026-03-31) - Fixed ultra trail 4-day plan showing 5 running days. v2.14 (2026-03-31) - Goal time in stats; version in header/footer. v2.13 (2026-03-30) - Fixed 25K/30K titles; peak LR hard cap. v2.12–v2.0 (2026-03-30) - See session history for full detail. ============================================================= Earlier versions (v1.x) predated formal versioning.