Commit aa8b5f4c authored by Cresson Remi's avatar Cresson Remi

FIX: correct IsInRange small bug

parent c3c36ab0
......@@ -88,9 +88,12 @@ public:
*/
bool IsInRange(const int& startMonth, const int& startDay, const int& nbOfDays) const
{
SingleDate startDate(year, startMonth, startDay);
SingleDate startDate1(year, startMonth, startDay);
SingleDate startDate2(year-1, startMonth, startDay);
return startDate.julianday <= julianday && julianday <= startDate.julianday + nbOfDays;
// Not very elegant but functional
return (startDate1.julianday <= julianday && julianday <= startDate1.julianday + nbOfDays) ||
(startDate2.julianday <= julianday && julianday <= startDate2.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