Commit 80a4ae49 authored by Volker Krause's avatar Volker Krause

Format years as date/time, not as number

Fixes year numbers being shown with digit group separators.
parent 7db57a95
......@@ -526,9 +526,9 @@ QString TripGroupManager::guessName(const TripGroup& g) const
Q_ASSERT(beginDt.daysTo(endDt) <= MaximumTripDuration);
if (beginDt.date().year() == endDt.date().year()) {
if (beginDt.date().month() == endDt.date().month()) {
return i18n("%1 (%2 %3)", dest, QLocale().monthName(beginDt.date().month(), QLocale::LongFormat), beginDt.date().year());
return i18n("%1 (%2 %3)", dest, QLocale().monthName(beginDt.date().month(), QLocale::LongFormat), beginDt.date().toString(QStringLiteral("yyyy")));
}
return i18n("%1 (%2/%3 %4)", dest, QLocale().monthName(beginDt.date().month(), QLocale::LongFormat), QLocale().monthName(endDt.date().month(), QLocale::LongFormat), beginDt.date().year());
return i18n("%1 (%2/%3 %4)", dest, QLocale().monthName(beginDt.date().month(), QLocale::LongFormat), QLocale().monthName(endDt.date().month(), QLocale::LongFormat), beginDt.date().toString(QStringLiteral("yyyy")));
}
return i18n("%1 (%3/%4)", dest, beginDt.date().year(), endDt.date().year());
return i18n("%1 (%3/%4)", dest, beginDt.date().toString(QStringLiteral("yyyy")), endDt.date().toString(QStringLiteral("yyyy")));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment