//不考虑日期,只考虑年和月
function IsGreaterThanM(start, end, m)
{
const startYear = start.getFullYear();
const endYear = end.getFullYear();
const startMonth = start.getMonth() + 1;
const endMonth = end.getMonth() + 1;
const startDay = start.getDate();
const endDay = end.getDate();
if (startYear === endYear) {
if (endMonth - startMonth > m) {
return true;
} else {
return false;
}
} else {
if (endYear - startYear > 1) {
return true;
} else if (endYear - startYear === 1) {
if (12 - startMonth + 1 + endMonth > m) {
return true;
} else {
return false;
}
}
}
}