In case end-parking-time ends with 00:00, set it to 23:59.

This commit is contained in:
Gerhard Hoffmann 2024-08-02 11:09:20 +02:00
parent 3dda2d8355
commit b394ed46cc

View File

@ -849,6 +849,12 @@ CalcState CALCULATE_LIBRARY_API compute_price_for_parking_ticket(
return calcState.set(CalcState::State::INVALID_START_DATE); return calcState.set(CalcState::State::INVALID_START_DATE);
} }
if (end_parking_time.time().hour() == 0 && end_parking_time.time().minute() == 0) {
end_parking_time = end_parking_time.addDays(-1);
end_parking_time.setTime(QTime(23, 59, 0));
}
qCritical() << __func__ << __LINE__ << "end_parking_time" << end_parking_time.toString(Qt::ISODate);
return calcState.set(CalcState::State::SUCCESS); return calcState.set(CalcState::State::SUCCESS);
} }