typescript how to check if string is a date
var isDate = function(date) {
return (new Date(date) !== "Invalid Date") && !isNaN(new Date(date));
}
typescript how to check if string is a date
var isDate = function(date) {
return (new Date(date) !== "Invalid Date") && !isNaN(new Date(date));
}
how to check if a variable is of type Date in javascript
export const isDate = date => ((new Date(date) instanceof Date) && !isNaN(new Date(date)) && isNaN(date))
// here third check is added to check if user adds values like 1 , 2 etc
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us