Commit efec74e0 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Fix date format, port related test from KLocale

parent 63f5b015
......@@ -141,7 +141,7 @@ void SummaryEventTester::test_Multiday()
SummaryEventInfo *ev1 = events2.at(0);
QCOMPARE(ev1->summaryText, multiDayAllDayInFuture);
QVERIFY(ev1->timeRange.isEmpty());
QCOMPARE(ev1->startDate, KLocale::global()->formatDate(QDate(today.addDays(multiDayFuture))));
QCOMPARE(ev1->startDate, QLocale::system().toString(today.addDays(multiDayFuture)));
QCOMPARE(ev1->daysToGo, QString::fromLatin1("in %1 days").arg(multiDayFuture));
QCOMPARE(ev1->makeBold, false);
// Make sure multiday is only displayed once
......
......@@ -204,14 +204,14 @@ SummaryEventInfo::List SummaryEventInfo::eventsForRange(const QDate &start, cons
str = i18nc("the appointment is tomorrow", "Tomorrow");
} else {
const auto locale = QLocale::system();
for (int i = 2; i < 7; ++i) {
for (int i = 3; i < 8; ++i) {
if (sD < currentDate.addDays(i)) {
str = locale.dayName(sD.dayOfWeek(), QLocale::LongFormat);
break;
}
}
if (str.isEmpty()) {
str = locale.toString(sD, QLocale::ShortFormat);
str = locale.toString(sD, QLocale::LongFormat);
}
}
summaryEvent->startDate = str;
......
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