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::Date::ADateFormat, QString> ADATEFORMATSMAP = {
10 {Opl::Date::ADateFormat::ISODate, ISO},
11 {Opl::Date::ADateFormat::DE, DE },
12 {Opl::Date::ADateFormat::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")
33 static QDate
formatInput(QString user_input, Opl::Date::ADateFormat format);
38 inline static QString
toString(
const QDate &date, Opl::Date::ADateFormat format = Opl::Date::ADateFormat::ISODate)
40 return date.toString(ADATEFORMATSMAP.value(format));
43 static const QStringList& getDisplayNames();
45 static const QString getFormatString(Opl::Date::ADateFormat format);