formatDateISO(10) // => { ok: false, error: Error('[dates.formatDateISO] Expected string value as input') }
Parameters
date: Date
The Date object to format.
Returns Result<string, Error>
A Result object with a string containing the formatted date
in the ISO 8601 format "yyyy-mm-dd" on success, or an Error object if the provided
input is not a valid Date object.
Formats a Date object into a string representation of the date in the ISO 8601 format "yyyy-mm-dd".
Example
Example
Handle invalid input: