common: Unify Date/Time formatting, UTC offset
authorShane Synan <digitalcircuit36939@gmail.com>
Thu, 23 Aug 2018 00:34:40 +0000 (19:34 -0500)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 28 Aug 2018 20:21:45 +0000 (22:21 +0200)
commit41a136e99bffde8e203fb1abff7c9affbbb16a8b
treebed28ecbd19fc66bdbbea134fb04678afe65ee47
parentebbd0abc75dc8c1e9e5786e3e63d478233746dd9
common: Unify Date/Time formatting, UTC offset

Unify date/time formatting for the client UI, using
Qt::DateFormat::DefaultLocaleShortDate to respect the operating
system's configured locale.  This avoids Qt's kind-of-weird default
date/time format that mixes numbers and named short months/days.

See https://doc.qt.io/qt-5/qt.html#DateFormat-enum

Modify AM/PM detection to use application locale, which currently
defaults to system locale.  This avoids any inconsistencies should
Quassel later allow specifying an application-wide locale different
from the system locale.

In CTCP VERSION replies, always use UTC time in ISO8601 date format,
avoiding locale-specific replies and timezone differences.  This
fixes client version statistic-tracking software from treating
different languages and different timezones as unique versions of
Quassel IRC.

In CTCP TIME replies, use local time in ISO8601 date format with
timezone offset.  This provides a consistent format for others to
parse and still provides the timezone information.

Work around a Qt bug for the latter.

See https://bugreports.qt.io/browse/QTBUG-26161
And https://stackoverflow.com/questions/18750569/qdatetime-isodate-with-timezone
src/common/util.cpp
src/common/util.h
src/core/coresessioneventprocessor.cpp
src/qtui/aboutdlg.cpp
src/qtui/coreinfodlg.cpp
src/qtui/coresessionwidget.cpp
src/uisupport/uistyle.cpp
src/uisupport/uistyle.h