toISO
function toISO(parts): string | null;YYYY-MM-DD for a complete, real date; null otherwise.
“Real” matters: the segments allow 31 while the month is unknown, so a user
can legitimately arrive at 31 February by typing the day first. That is not a
date, and this returns null for it rather than silently rolling over into
March the way new Date(2026, 1, 31) would.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
parts | DateParts |
Returns
Section titled “Returns”string | null