DCPlugin/src/ATBAPP/support/TicketUtils.h
Siegfried Siegert 1bcdb5ba21
Add TicketUtils class for ...
Ticket helper methods e.g. string format helpers.
Currently only on method for getting a date string in short format
according to selected language.
2024-08-08 10:10:27 +02:00

35 lines
838 B
C++

#ifndef TICKETUTILS_H
#define TICKETUTILS_H
#include <QObject>
class TicketUtils : public QObject
{
Q_OBJECT
public:
explicit TicketUtils(QObject *parent = nullptr);
/**
* @brief getLocaleDateString
* @param qLocale
* @param qDate
* @return a localized date string short format
*
* Note QLocale::ShortFormat does not result to the
* string we need for ticket printing therefore this
* helper method was created.
*
* e.g. using Lithuanian (lt_LT) we get a date in short format:
* "2024-08-08" unfortunately this is to long, we need
* the year with only two digits.
* e.g. in German (de_DE) it is enought: "08.08.24"
*
*/
static QString getLocaleDateString(const QLocale &qLocale, const QDate &qDate);
signals:
};
#endif // TICKETUTILS_H