GetDailyTicketDuration():
replace ZellersAlgorithm by qts build in method dayOfWeek().
This commit is contained in:
parent
ebb5bad7c5
commit
8d7d175b51
@ -39,7 +39,7 @@ QDateTime Calculator::GetDailyTicketDuration(Configuration* cfg, const QDateTime
|
||||
|
||||
int daily_card_price = cfg->PaymentOption.find(payment_option)->second.pop_daily_card_price;
|
||||
if(daily_card_price <= 0) {
|
||||
qCritical() << "Calculator::GetDailyTicketDuration(): Daily ticket price zero or less");
|
||||
qCritical() << "Calculator::GetDailyTicketDuration(): Daily ticket price zero or less";
|
||||
return QDateTime();
|
||||
}
|
||||
|
||||
@ -74,12 +74,10 @@ QDateTime Calculator::GetDailyTicketDuration(Configuration* cfg, const QDateTime
|
||||
else
|
||||
{
|
||||
// Get day of week
|
||||
int weekdayId = 0;
|
||||
weekdayId = Utilities::ZellersAlgorithm(inputDateTime.date().day(),inputDateTime.date().month(),inputDateTime.date().year());
|
||||
int const weekdayId = inputDateTime.date().dayOfWeek();
|
||||
|
||||
// If no working day found, skip it (recursively call method again)
|
||||
size_t found = 0;
|
||||
found = cfg->WeekDaysWorktime.count(weekdayId);
|
||||
size_t found = cfg->WeekDaysWorktime.count(weekdayId);
|
||||
|
||||
// When no workday found, go to next available day
|
||||
if(found <=0)
|
||||
|
Loading…
Reference in New Issue
Block a user