Skip to content

Commit

Permalink
Merge pull request #92 from shane-kerr/we-love-en_DK
Browse files Browse the repository at this point in the history
Work around evil Qt prejudice against en_DK
  • Loading branch information
shane-kerr authored Sep 9, 2018
2 parents 5065e21 + a535ac3 commit 3c71e6a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ namespace GUIUtil {

QString dateTimeStr(const QDateTime &date)
{
return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm");
// Qt doesn't accept the en_DK locale, because reasons:
// https://bugreports.qt.io/browse/QTBUG-59382
// We love the en_DK locale, so work around this rejection of all
// that good in the world.
if (QLocale().name().toStdString() == "en_DK") {
return date.date().toString(Qt::ISODate) + QString(" ") + date.toString("hh:mm");
} else {
return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm");
}
}

QString dateTimeStr(qint64 nTime)
Expand Down

0 comments on commit 3c71e6a

Please sign in to comment.