验证日期格式为yyyy-mm-dd的日期的正确性
需要把附件中的js导入页面
去掉空白字符
function isDate(b){
var birth = b.split('-');
var bir = birth[1]+'/'+birth[2]+'/'+birth[0];
var d = new Date(bir);
var dd = d.format('mm/dd/yyyy');
var df = dd.split('/');
if(df[2]!=birth[0]||df[0]!=birth[1]||df[1]!=birth[2]){
return false;
}
return true;
}
function isDateS(b){
var a = /^\d{4}[-]\d{2}[-]\d{2}$/;
if(!a.test(b)){
return false;
}
return true;
}
需要把附件中的js导入页面
去掉空白字符
String.prototype.Trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}
String.prototype.LTrim = function()
{
return this.replace(/(^\s*)/g, "");
}
String.prototype.Rtrim = function()
{
return this.replace(/(\s*$)/g, "");
}