日期:2014-05-16  浏览次数:20313 次

js计算两个时间之间的天数差

                        //判断是否为闰年
                        function isLeapYear(year){
                        if(year % 4 == 0 && ((year % 100 != 0) || (year % 400 == 0)))
                        {
                             return true;
                        }
                        return false;
                        }
                        //判断前后两个日期
                        function validatePeriod(fyear,fmonth,fday,byear,bmonth,bday){
                        if(fyear < byear){
                        return true;
                        }else if(fyear == byear){
                        if(fmonth < bmonth){
                           return true;
                        } else if (fmonth == bmonth){
                           if(fday <= bday){
                            return true;
                           }else {
                            return false;
                           }
                        } else {
                           return false;
                &