function FORM(){
return {
"data":{
"begin":"2022-01-01",
"end":"2022-01-31"
}
}
}
function overMonth() {
var starDate = FORM().data.begin;
var endDate = FORM().data.end;
if (starDate && endDate) {
var sDate = new Date(starDate).getTime();
var eDate = new Date(endDate).getTime();
var date = new Date(starDate);
date.setMonth(date.getMonth() + 1);
date.setDate(0);
var days = date.getDate();
var thisMothDays = 1000 * 3600 * 24 * days
if (eDate - sDate >= thisMothDays) {
return false
} else {
return true
}
}
else {
return true
}
}
result = overMonth()
console.log(result)
console