IsYearPeriodActive(): return true, even if no YearPeriod is given in tariff-json-file.
This commit is contained in:
parent
9dcf7a8f30
commit
282a412ef5
@ -197,7 +197,8 @@ bool Utilities::IsYearPeriodActive(Configuration* cfg, struct tm* currentDateTim
|
||||
}
|
||||
|
||||
bool Utilities::IsYearPeriodActive(Configuration const *cfg, QDateTime const &dt) {
|
||||
if (std::none_of(cfg->YearPeriod.cbegin(),
|
||||
if ((cfg->YearPeriod.size() > 0) &&
|
||||
std::none_of(cfg->YearPeriod.cbegin(),
|
||||
cfg->YearPeriod.cend(),
|
||||
[&dt](std::pair<int, ATBPeriodYear> const &year) {
|
||||
QDate const d(2004, // 2004 is a leap year
|
||||
|
Loading…
Reference in New Issue
Block a user