js 验证日期格式
function CheckDateFormat(_value) {
//var a = /^(\d{4})-(\d{2})-(\d{2})$/;
// var a = /^(\d{4})(-|\/)(\d{2})(-|\/)(\d{2})$/;
var a = /^(\d{4})(\/)(\d{2})(\/)(\d{2})$/;
if (!a.test(_value)) {
// alert("日期格式不正确!")
alert("Incorrect date format.");
return false
}
else
return true
}
浙公网安备 33010602011771号