5 const static auto ISO = QStringLiteral(
"yyyy-MM-dd");
6 const static auto DE = QStringLiteral(
"dd.MM.yyyy");
7 const static auto EN = QStringLiteral(
"MM/dd/yyyy");
9 const static QMap<OPL::DateFormat, QString> ADATEFORMATSMAP = {
10 {OPL::DateFormat::ISODate, ISO},
11 {OPL::DateFormat::DE, DE },
12 {OPL::DateFormat::EN, EN },
16 const static QStringList DISPLAY_NAMES = {
17 QStringLiteral(
"ISO 8601: yyyy-MM-dd"),
18 QStringLiteral(
"DE: dd.MM.yyyy"),
19 QStringLiteral(
"EN: MM/dd/yyyy")
45 static void padZeroes(QString &io_user_input);
47 static void addSeperators(QString &io_user_input,
const OPL::DateFormat &format);
49 static bool containsSeperator(
const QString &user_input);
56 return date.toString(ADATEFORMATSMAP.value(format));
59 static const QStringList& getDisplayNames();
The ADate class is responsible for input/output of Dates and handling the different Date Formats.
Definition: adate.h:27
static void padCentury(QString &io_user_input, OPL::DateFormat format)
padCentury adds the century to a date where it was omitted
Definition: adate.cpp:36
static QDate parseInput(QString &io_user_input, OPL::DateFormat format)
takes a user-provided input and tries to convert it to a (valid) QDate.
Definition: adate.cpp:3
static const QString currentDate()
today Returns a string containing the current date in ISO format
Definition: adate.cpp:135
static QString toString(const QDate &date, OPL::DateFormat format=OPL::DateFormat::ISODate)
Reimplements QDate::toString to accept OPL::Date::ADateFormat enums.
Definition: adate.h:54
static void padZeroes(QString &io_user_input)
pads a user-provided date string with 0s to facilitate conversion to QDate
Definition: adate.cpp:67
DateFormat
ADateFormats enumerates the accepted date formats for QDateEdits.
Definition: opl.h:92