I'm encountering an issue with validating the specified string obtained from the new Date()
Object.
"2020-10-06T14:23:43.964Z"
. I anticipate receiving either this particular input format or a new Date()
. My aim is to create something that can handle this scenario, similar to:
const checkDateValidity = (d: Date):boolean => {
if (d instanceof Date || /* validate Date string here */) {
return true
}
return false
}