📜  检查日期格式 javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:53.632000             🧑  作者: Mango

代码示例2
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