#ifndef CALCULATE_PARKING_TICKETS_UTILS_H_INCLUDED
#define CALCULATE_PARKING_TICKETS_UTILS_H_INCLUDED

#include <QDateTime>
#include <QDate>
#include <QTime>
#include <QTimeZone>

struct parking_tariff_t;

namespace TUtils {
    QDateTime const fromSecs(quint64 secs);
    QDateTime const fromMinutes(quint64 minutes);

    quint64 toSecs(QDateTime const &dt);
    quint64 toMinutes(QDateTime const &dt);

    bool isHoliday(parking_tariff_t const *tariff, QDate const &qdt);

    bool isMon(quint64 secs);
    bool isMon(QDate const &date);
    bool isMonUTC(quint64 secsSinceEpoch = QDateTime::currentSecsSinceEpoch());
    bool isMonUTC(QDate const &dateSinceEpoch = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch(), Qt::UTC).date());
    bool isMonCET(quint64 secsSinceEpoch = QDateTime::currentSecsSinceEpoch());
    bool isMonCET(QDate const &dateSinceEpoch = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch()).date());

    bool isTue(QDate const &date);
    bool isTueUTC(quint64 secsSinceEpoch = QDateTime::currentSecsSinceEpoch());
    bool isTueUTC(QDate const &dateSinceEpoch = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch(), Qt::UTC).date());
    bool isTueCET(quint64 secsSinceEpoch = QDateTime::currentSecsSinceEpoch());
    bool isTueCET(QDate const &dateSinceEpoch = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch()).date());

    bool isWed(QDate const &date);
    bool isWedUTC(quint64 secsSinceEpoch = QDateTime::currentSecsSinceEpoch());
    bool isWedUTC(QDate const &dateSinceEpoch = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch(), Qt::UTC).date());
    bool isWedCET(quint64 secsSinceEpoch = QDateTime::currentSecsSinceEpoch());
    bool isWedCET(QDate const &dateSinceEpoch = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch()).date());

    bool isThu(QDate const &date);
    bool isThuUTC(quint64 secsSinceEpoch = QDateTime::currentSecsSinceEpoch());
    bool isThuUTC(QDate const &dateSinceEpoch = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch(), Qt::UTC).date());
    bool isThuCET(quint64 secsSinceEpoch = QDateTime::currentSecsSinceEpoch());
    bool isThuCET(QDate const &dateSinceEpoch = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch()).date());

    bool isFri(QDate const &date);
    bool isFriUTC(quint64 secsSinceEpoch = QDateTime::currentSecsSinceEpoch());
    bool isFriUTC(QDate const &dateSinceEpoch = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch(), Qt::UTC).date());
    bool isFriCET(quint64 secsSinceEpoch = QDateTime::currentSecsSinceEpoch());
    bool isFriCET(QDate const &dateSinceEpoch = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch()).date());

    bool isSat(QDate const &date);
    bool isSatUTC(quint64 secsSinceEpoch = QDateTime::currentSecsSinceEpoch());
    bool isSatUTC(QDate const &dateSinceEpoch = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch(), Qt::UTC).date());
    bool isSatCET(quint64 secsSinceEpoch = QDateTime::currentSecsSinceEpoch());
    bool isSatCET(QDate const &dateSinceEpoch = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch()).date());

    bool isSun(QDate const &date);
    bool isSunUTC(quint64 secsSinceEpoch = QDateTime::currentSecsSinceEpoch());
    bool isSunUTC(QDate const &dateSinceEpoch = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch(), Qt::UTC).date());
    bool isSunCET(quint64 secsSinceEpoch = QDateTime::currentSecsSinceEpoch());
    bool isSunCET(QDate const &dateSinceEpoch = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch()).date());
}

#endif // CALCULATE_PARKING_TICKETS_UTILS_H_INCLUDED
