Fix for Android for adept_loan_mgt.cpp (strptime format)

This commit is contained in:
Grégory Soutadé 2024-01-06 09:22:11 +01:00
parent 92a67312bd
commit fd38e84da6

View File

@ -183,8 +183,13 @@ private:
loan->bookName = node.first_child().value(); loan->bookName = node.first_child().value();
struct tm tm; struct tm tm;
#ifdef __ANDROID__
res = strptime(loan->validity.c_str(), "%Y-%m-%dT%H:%M:%S%z", &tm);
#else
res = strptime(loan->validity.c_str(), "%Y-%m-%dT%H:%M:%S%Z", &tm); res = strptime(loan->validity.c_str(), "%Y-%m-%dT%H:%M:%S%Z", &tm);
if (*res == 0) #endif
if (res != NULL && *res == 0)
{ {
if (mktime(&tm) <= time(NULL)) if (mktime(&tm) <= time(NULL))
loan->validity = " (Expired)"; loan->validity = " (Expired)";