From f87399ed448f11595034c4b8d6a5e39ade006572 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Wed, 31 Jan 2024 11:42:33 +0100 Subject: [PATCH] Fixed getWeekDayWorkTime(). Parameter 'time' must be inside [from, to[. --- library/src/configuration.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/src/configuration.cpp b/library/src/configuration.cpp index 67ad64f..242d714 100644 --- a/library/src/configuration.cpp +++ b/library/src/configuration.cpp @@ -579,9 +579,11 @@ Configuration::getWeekDayWorkTime(QTime const &time, Qt::DayOfWeek dayOfWeek) { std::multimap::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); } }