diff --git a/library/src/calculate_price.cpp b/library/src/calculate_price.cpp index d14eea7..935b872 100644 --- a/library/src/calculate_price.cpp +++ b/library/src/calculate_price.cpp @@ -996,15 +996,20 @@ CalcState CALCULATE_LIBRARY_API compute_duration_for_parking_ticket( } else { ticketEndTime = QDateTime::fromString(endTime,Qt::ISODate); - // DEBUG - //qCritical() << "compute_duration_for_parking_ticket(): "; - //qCritical() << " endTime: " << endTime; - //qCritical() << " ticketEndTime: " << ticketEndTime; - if (!ticketEndTime.isValid()) { calcState.setDesc(QString("ticketEndTime=%1").arg(endTime)); return calcState.set(CalcState::State::WRONG_ISO_TIME_FORMAT); } + + if (ticketEndTime.time().hour() == 0 && ticketEndTime.time().minute() == 0) { + ticketEndTime = ticketEndTime.addDays(-1); + ticketEndTime.setTime(QTime(23, 59, 0)); + } + + // DEBUG + qCritical() << "compute_duration_for_parking_ticket(): "; + qCritical() << " endTime: " << endTime; + qCritical() << " ticketEndTime: " << ticketEndTime; } } else { return calcState.set(CalcState::State::INVALID_START_DATE);