Utilities::IsYearPeriodActive():
Fix: take into account if start-date <= end-date or not. Otherwise check is wrong, and no valid year period is returned.
This commit is contained in:
parent
9b524d63e5
commit
80637260f3
@ -207,7 +207,13 @@ bool Utilities::IsYearPeriodActive(Configuration const *cfg, QDateTime const &dt
|
|||||||
dt.date().day());
|
dt.date().day());
|
||||||
QDate const s(2004, year.second.pye_start_month, year.second.pye_start_day);
|
QDate const s(2004, year.second.pye_start_month, year.second.pye_start_day);
|
||||||
QDate const e(2004, year.second.pye_end_month, year.second.pye_end_day);
|
QDate const e(2004, year.second.pye_end_month, year.second.pye_end_day);
|
||||||
return (d >= s && d <= e);
|
//qCritical() << __func__ << __LINE__ << " d" << d.toString(Qt::ISODate);
|
||||||
|
//qCritical() << __func__ << __LINE__ << "start" << s.toString(Qt::ISODate);
|
||||||
|
//qCritical() << __func__ << __LINE__ << " end" << e.toString(Qt::ISODate);
|
||||||
|
if (s <= e) {
|
||||||
|
return (d >= s && d <= e);
|
||||||
|
}
|
||||||
|
return (d >= s || d <= e);
|
||||||
})) {
|
})) {
|
||||||
qCritical() << "NO VALID YEAR PERIOD";
|
qCritical() << "NO VALID YEAR PERIOD";
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user