I am working with a mysql database that takes dates as YYYY-MM-DD.(我正在使用日期为YYYY-MM-DD的mysql数据库。)
I have an array named dates that contains so inputted values, I am trying to check to see if the inputted values are in the format YYYY-MM-DD and if they aren't then add them to the wrongdates array however i am completely lost on the logic that goes in the if statement to check if the format is correct(我有一个名为date的数组,其中包含如此输入的值,我试图检查输入的值是否为YYYY-MM-DD格式,如果没有,则将它们添加到错误的dates数组中,但是我完全迷失了在if语句中检查格式是否正确的逻辑上)
var wrongdates = [];
for(x=0;x<dates.length<x++){
if(.........){
wrongdates.push(dates[x].value);
}
}
window.alert(wrongdates);
ask by Anna translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…