@sheetwrite/corefunction
Parse a user-typed date string into a serial, or null when it is not a date.
Accepted forms:
- ISO
yyyy-mm-dd(e.g.2026-07-06); - ISO date-time
yyyy-mm-dd hh:mmoryyyy-mm-dd hh:mm:ss(aTseparator is also accepted); the fractional serial carries the time; - slash
dd/mm/yyyyandmm/dd/yyyy, disambiguated conservatively: if one component exceeds 12 it must be the day and the layout is unambiguous; when both are ≤ 12 the value is ambiguous (e.g.04/05/2026) and is read as mm/dd — Google Sheets' default (US) locale. Both > 12 is rejected.
Anything else (bare numbers, free text) returns null so callers can fall back
to a text literal.
Declaration
function parseDateInput(raw: string): number | null