A functional toolkit for authoring resource-leveling algorithms — compose constraint and scoring blocks, enumerate feasible schedules
0

Configure Feed

Select the types of activity you want to include in your feed.

feat(dates): DST-safe project date parse/format helpers

parseProjectDate / formatProjectDate centralize conversion between project
date strings and timestamps. Parsing guards against NaN so a malformed
date surfaces as a clear failure rather than a silent Invalid Date, and
the arithmetic is DST-safe so a date round-trips across spring-forward and
fall-back boundaries.

Russ T. Fugal (Mar 9, 2026, 10:00 AM -0600) 53d80f65 5c7f902a

+20
+20
src/dateTime.ts
··· 1 + export function parseProjectDate(raw: string | null | undefined): Date | null { 2 + if (!raw) return null; 3 + const date = new Date(raw); 4 + return Number.isNaN(date.getTime()) ? null : date; 5 + } 6 + 7 + export function formatProjectDate(value: Date | null | undefined): string | null { 8 + if (!value) { 9 + return null; 10 + } 11 + 12 + const year = value.getFullYear(); 13 + const month = String(value.getMonth() + 1).padStart(2, "0"); 14 + const day = String(value.getDate()).padStart(2, "0"); 15 + const hours = String(value.getHours()).padStart(2, "0"); 16 + const minutes = String(value.getMinutes()).padStart(2, "0"); 17 + const seconds = String(value.getSeconds()).padStart(2, "0"); 18 + 19 + return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`; 20 + }