function fucChedkDate(strValue) //strValue 为要检验的时间日期格式为20070929
{
var intYear = parseInt(strValue.substring(0,4),10); //取年份(比如2007)
var intMonth = parseInt(strValue.substring(4,6),10); //取月份(比如9)
var intDay = parseInt(strValue.substring(6,8),10); //取日(比如29)
var arrayLookup = {'1': 31,'3': 31,'4':30,'5':31,'6':30,'7':31,'8':31,'9':30,'10':31,'11':30,'12':31};
if(arrayLookup[intMonth] != null)
{
if(intDay > arrayLookup[intMonth] && intDay != 0)
{
//alert("查询时间中日期有误");
return 0;
}
}
if(intMonth-2 == 0)
{
var booLeapYear = (intYear % 4 == 0 && (intYear % 100 != 0 || intYear % 400 == 0));
if(((booLeapYear && intDay <= 29) || (!booLeapYear && intDay <=28)) && intDay !=0)
{
return 1;
}
else
{
//alert("查询时间2月中日期有误");
return 0;
}
}
}
{
var intYear = parseInt(strValue.substring(0,4),10); //取年份(比如2007)
var intMonth = parseInt(strValue.substring(4,6),10); //取月份(比如9)
var intDay = parseInt(strValue.substring(6,8),10); //取日(比如29)
var arrayLookup = {'1': 31,'3': 31,'4':30,'5':31,'6':30,'7':31,'8':31,'9':30,'10':31,'11':30,'12':31};
if(arrayLookup[intMonth] != null)
{
if(intDay > arrayLookup[intMonth] && intDay != 0)
{
//alert("查询时间中日期有误");
return 0;
}
}
if(intMonth-2 == 0)
{
var booLeapYear = (intYear % 4 == 0 && (intYear % 100 != 0 || intYear % 400 == 0));
if(((booLeapYear && intDay <= 29) || (!booLeapYear && intDay <=28)) && intDay !=0)
{
return 1;
}
else
{
//alert("查询时间2月中日期有误");
return 0;
}
}
}