<script>
function CheckIsDate(value)
{
var strValue = new String();
var year = new String();
var month = new String();
var day = new String();
strValue = value;
if (strValue.length=null)
alert("日期不能为空!");
if (strValue.length!=10 )
{
return false;
}
else
if (strValue.charAt(4)!='.'||strValue.charAt(7)!='.')
{
return false;
}
else
{
year = strValue.substr(0,4);
month = strValue.substr(5,2);
month = month-1;
day = strValue.substr(8,2);
var testDate = new Date(year,month,day);
return (year == testDate.getFullYear()) && (month ==testDate.getMonth())&&(day == testDate.getDate());
}
}
return true;
}
</script>
function CheckIsDate(value)
{
var strValue = new String();
var year = new String();
var month = new String();
var day = new String();
strValue = value;
if (strValue.length=null)
alert("日期不能为空!");
if (strValue.length!=10 )
{
return false;
}
else
if (strValue.charAt(4)!='.'||strValue.charAt(7)!='.')
{
return false;
}
else
{
year = strValue.substr(0,4);
month = strValue.substr(5,2);
month = month-1;
day = strValue.substr(8,2);
var testDate = new Date(year,month,day);
return (year == testDate.getFullYear()) && (month ==testDate.getMonth())&&(day == testDate.getDate());
}
}
return true;
}
</script>
function CheckIsDate(value)
{
var strValue = new String();
var year = new String();
var month = new String();
var day = new String();
strValue = value;
if (strValue.length=null)
alert("日期不能为空!");
if (strValue.length!=10 )
{
return false;
}
else
if (strValue.charAt(4)!='.'||strValue.charAt(7)!='.')
{
return false;
}
else
{
year = strValue.substr(0,4);
month = strValue.substr(5,2);
month = month-1;
day = strValue.substr(8,2);
var testDate = new Date(year,month,day);
return (year == testDate.getFullYear()) && (month ==testDate.getMonth())&&(day == testDate.getDate());
}
return true;
}
</script>