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