getDateString()function

getDateString(value?: unknown): string | undefined
ParamType
valueunknown
Any value that we want to parse as a valid date.
Return
string | undefined
The local date string, or undefined if value couldn't be converted.

Convert an unknown value to a local date string like "2015-09-12", or undefined if it couldn't be converted.

Examples

getDateString("2015-09-12T18:30:00") // "2015-09-12"