Fix: Check if endTime is still on the same day.
This commit is contained in:
parent
4d5583df2d
commit
6a5272da7a
@ -649,8 +649,10 @@ CalcState Calculator::isParkingAllowedForWeekDay(Configuration const *cfg,
|
|||||||
QTime const &startTime = start.time();
|
QTime const &startTime = start.time();
|
||||||
|
|
||||||
if (startTime >= from && startTime <= until) {
|
if (startTime >= from && startTime <= until) {
|
||||||
QTime const endTime = start.addSecs(netto_parking_time*60).time();
|
QDateTime const end = start.addSecs(netto_parking_time*60);
|
||||||
if (endTime <= until) {
|
QTime const endTime = end.time();
|
||||||
|
if (endTime <= until && start.date().dayOfWeek() == end.date().dayOfWeek()) {
|
||||||
|
qCritical() << DBG_HEADER;
|
||||||
return CalcState(CalcState::State::SUCCESS, "PARKING_ALLOWED", from, until);
|
return CalcState(CalcState::State::SUCCESS, "PARKING_ALLOWED", from, until);
|
||||||
} else {
|
} else {
|
||||||
errorStr = QString("%1 startTime not in range (%2 not in [%3, %4))")
|
errorStr = QString("%1 startTime not in range (%2 not in [%3, %4))")
|
||||||
|
Loading…
Reference in New Issue
Block a user