Fixed getWeekDayWorkTime(). Parameter 'time' must be inside [from, to[.

This commit is contained in:
Gerhard Hoffmann 2024-01-31 11:42:33 +01:00
parent 868df3dd32
commit f87399ed44

View File

@ -579,9 +579,11 @@ Configuration::getWeekDayWorkTime(QTime const &time, Qt::DayOfWeek dayOfWeek) {
std::multimap<int, ATBWeekDaysWorktime>::const_iterator it = this->WeekDaysWorktime.find((int)dayOfWeek);
if (it != this->WeekDaysWorktime.cend()) {
ATBWeekDaysWorktime const &wt = it->second;
if (QTime::fromString(wt.pwd_time_from.c_str(), Qt::ISODate) >= time
&& QTime::fromString(wt.pwd_time_to.c_str(), Qt::ISODate) < time) {
if (time >= QTime::fromString(wt.pwd_time_from.c_str(), Qt::ISODate)
&& time < QTime::fromString(wt.pwd_time_to.c_str(), Qt::ISODate)) {
value = value.value_or(wt);
}
}