I'm trying to get the months between 2 years, for example I have a project that starts on 2021-10-15 and it ends on 2022-05-03 and what I'm trying to do is get it to return true only for the months that is between those dates, so for example it would return true for oct, nov, dec, jan, feb, mar, apr, may.
The issue I have is that the way my code is it returns true but it goes from may - oct instead of oct - may.
Here is my code
dateRange(project, month){
let startMonth = project.startDate.split('-')[1];
let endMonth = project.endDate.split('-')[1];
return month >= start_month && month <= end_month;
}