X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/3fc700f0421f801c4c89c075155009ce67667f10..ed0df8dc1fc9576e36c920882e7f4b00a2811113:/src/dolphinmodel.cpp diff --git a/src/dolphinmodel.cpp b/src/dolphinmodel.cpp index 76bd86264..bb1fd36dd 100644 --- a/src/dolphinmodel.cpp +++ b/src/dolphinmodel.cpp @@ -221,8 +221,7 @@ QVariant DolphinModel::displayRoleData(const QModelIndex& index) const modifiedWeek = 53; } - if (currentDate.year() == modifiedDate.year() && - currentDate.month() == modifiedDate.month()) { + if (currentDate.year() == modifiedDate.year() && currentDate.month() == modifiedDate.month()) { switch (currentWeek - modifiedWeek) { case 0: switch (daysDistance) { @@ -248,7 +247,8 @@ QVariant DolphinModel::displayRoleData(const QModelIndex& index) const Q_ASSERT(false); } } else { - if (daysDistance <= (currentDate.day() + modifiedDate.daysInMonth())) { + const QDate lastMonthDate = currentDate.addMonths(-1); + if (lastMonthDate.year() == modifiedDate.year() && lastMonthDate.month() == modifiedDate.month()) { if (daysDistance == 1) { retString = i18nc("@title:group Date: %B is full month name in current locale, and %Y is full year number", "Yesterday (%B, %Y)"); } else if (daysDistance <= 7) {