OPL::DateTime(3)

NAME
OPL::DateTime

SYNOPSIS

  Static Public Member Functions
static QString dateToString (const QDate &date, OPL::DateFormat format=OPL::DateFormat::ISODate)
Reimplements QDate::toString to accept OPL::Date::DateFormat enums.
static QDate parseInput (QString &user_input, OPL::DateFormat format)
takes a user-provided input and tries to convert it to a (valid) QDate.
static void tryToFix (QString &user_input, OPL::DateFormat format)
static void padCentury (QString &io_user_input, OPL::DateFormat format)
padCentury adds the century to a date where it was omitted
static void padZeroes (QString &io_user_input)
pads a user-provided date string with 0s to facilitate conversion to QDate
static void addSeperators (QString &io_user_input, const OPL::DateFormat &format)
static bool containsSeperator (const QString &user_input)
static const QStringList & getDisplayNames ()
static const QString getFormatString (OPL::DateFormat format)
static const QString currentDate ()
today Returns a string containing the current date in ISO format
static const QString dateTimeToString (const QDateTime &date_time, OPL::DateTimeFormat format)
dateTimeToString formats a QDateTime object into a string in a uniform way.
static QDateTime fromString (const QString &date_time_string)

  Static Public Attributes
static const QString ISO_FORMAT_STRING = QStringLiteral('yyyy-MM-dd')
static const QString DE_FORMAT_STRING = QStringLiteral('dd.MM.yyyy')
static const QString EN_FORMAT_STRING = QStringLiteral('MM/dd/yyyy')
static const QMap< OPL::DateFormat, QString > DATEFORMATSMAP
static const QStringList DISPLAY_NAMES

Member Function Documentation

  const QString OPL::DateTime::currentDate () [static]

today Returns a string containing the current date in ISO format

Returns

  static const QString OPL::DateTime::dateTimeToString (const QDateTime & date_time, OPL::DateTimeFormat format) [inline], [static]

dateTimeToString formats a QDateTime object into a string in a uniform way.

Returns

  QDate OPL::DateTime::parseInput (QString & user_input, OPL::DateFormat format) [static]

takes a user-provided input and tries to convert it to a (valid) QDate.

Returns
    QDate (invalid if input not recognized)

Member Data Documentation

  const QMap<OPL::DateFormat, QString> OPL::DateTime::DATEFORMATSMAP [inline], [static]
Initial value:

= {
        {OPL::DateFormat::ISODate, ISO_FORMAT_STRING},
        {OPL::DateFormat::DE,      DE_FORMAT_STRING },
        {OPL::DateFormat::EN,      EN_FORMAT_STRING },
    }

  const QStringList OPL::DateTime::DISPLAY_NAMES [inline], [static]
Initial value:

= {
        QStringLiteral("ISO 8601: yyyy-MM-dd"),
        QStringLiteral("DE: dd.MM.yyyy"),
        QStringLiteral("EN: MM/dd/yyyy")
    }

Author

Generated automatically by Doxygen for openPilotLog from the source code.