Extracts the day of the month as a number from a given date string.
dayOfMonth("07/03/2023")// => { ok: true, value: '3' } Copy
dayOfMonth("07/03/2023")// => { ok: true, value: '3' }
Handle invalid input:
dayOfMonth(10)// => { ok: false, error: Error('[dates.dayOfMonth] Expected string value as input') } Copy
dayOfMonth(10)// => { ok: false, error: Error('[dates.dayOfMonth] Expected string value as input') }
The date string to extract the day of the month from.
A Result object with either the day of the month as a number on success, or an Error object if the input value is not a valid date string.
Result
Error
Generated using TypeDoc v0.24.7
Extracts the day of the month as a number from a given date string.
Example
Example
Handle invalid input: