24-hour ticket
This commit is contained in:
parent
8a7828c1e6
commit
6ea58be34d
@ -31,5 +31,5 @@ public:
|
|||||||
QString GetDailyTicketDuration(Configuration* cfg, QString start_datetime, uint8_t payment_option, bool carry_over);
|
QString GetDailyTicketDuration(Configuration* cfg, QString start_datetime, uint8_t payment_option, bool carry_over);
|
||||||
|
|
||||||
// 24-hour daily ticket
|
// 24-hour daily ticket
|
||||||
QString Get24HourTicketDuration(Configuration* cfg, QString start_datetime, uint8_t payment_option, bool carry_over);
|
QString Get24HourTicketDuration(Configuration* cfg, QString start_datetime, uint8_t payment_option);
|
||||||
};
|
};
|
||||||
|
@ -20,7 +20,7 @@ inline struct tm* localtime_r(const time_t *clock, struct tm* result){
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString Calculator::Get24HourTicketDuration(Configuration *cfg, QString start_datetime, uint8_t payment_option, bool carry_over)
|
QString Calculator::Get24HourTicketDuration(Configuration *cfg, QString start_datetime, uint8_t payment_option)
|
||||||
{
|
{
|
||||||
if(start_datetime.isNull() || start_datetime.isEmpty()) return "Invalid date-time";
|
if(start_datetime.isNull() || start_datetime.isEmpty()) return "Invalid date-time";
|
||||||
protection_counter = 0;
|
protection_counter = 0;
|
||||||
|
@ -33,7 +33,7 @@ int main() {
|
|||||||
{
|
{
|
||||||
struct price_t price;
|
struct price_t price;
|
||||||
memset(&price, 0x00, sizeof(price));
|
memset(&price, 0x00, sizeof(price));
|
||||||
QDateTime start = QDateTime::fromString("2023-06-02T13:03:00.000Z",Qt::ISODate); //QDateTime::currentDateTime();
|
QDateTime start = QDateTime::fromString("2023-06-01T07:50:00.000Z",Qt::ISODate); //QDateTime::currentDateTime();
|
||||||
time_t start_parking_time = start.toSecsSinceEpoch() / 60;
|
time_t start_parking_time = start.toSecsSinceEpoch() / 60;
|
||||||
time_t end_parking_time = start_parking_time + 1230;
|
time_t end_parking_time = start_parking_time + 1230;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user