Answers for "javascript check if data type is date format"

0

typescript how to check if string is a date

var isDate = function(date) {
    return (new Date(date) !== "Invalid Date") && !isNaN(new Date(date));
}
Posted by: Guest on May-31-2021
-1

check date format javascript

if (date.match(/^\d{4}-\d{2}-\d{2}$/) === null) {
   //it is not a date with format YYYY-MM-DD
 }
else 
  //it is a date with format YYYY-MM-DD
Posted by: Guest on June-11-2021

Code answers related to "javascript check if data type is date format"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language