Commit bab841be authored by remi cresson's avatar remi cresson

FIX: IsInRange function now exact

parent aa8b5f4c
......@@ -84,16 +84,11 @@ public:
}
/*
* Return true if the date is in the time range given by (startmonth; startday; nbOfDays)
* Return true if the date is in the time range given by (starDate, nbOfDays)
*/
bool IsInRange(const int& startMonth, const int& startDay, const int& nbOfDays) const
bool IsInRange(SingleDate startDate, const int& nbOfDays) const
{
SingleDate startDate1(year, startMonth, startDay);
SingleDate startDate2(year-1, startMonth, startDay);
// Not very elegant but functional
return (startDate1.julianday <= julianday && julianday <= startDate1.julianday + nbOfDays) ||
(startDate2.julianday <= julianday && julianday <= startDate2.julianday + nbOfDays) ;
return (startDate.julianday <= julianday && julianday <= startDate.julianday + nbOfDays);
}
int day;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment