SUMMARY The smart dates for the message listing appears to be stuck on the day that KMail was launched. So it will display "today" for any message received on that day, but will not update it when the day changes. STEPS TO REPRODUCE 1. Open KMail 2. Wait for midnight 3. Find a message received before midnight OBSERVED RESULT It displays "today" EXPECTED RESULT It should display "yesterday" SOFTWARE/OS VERSIONS KDE Plasma Version: 6.0.2 KDE Frameworks Version: 6.0.0 Qt Version: 6.6.2 ADDITIONAL INFORMATION Same as #178035, but that was fixed 16 years ago. The problem has reoccurred.
Created attachment 167535 [details] Screenshot showing the problem
Still happening as of KMail 6.1.0.
Created attachment 171892 [details] Problem in KMail 6.1.2
*** Bug 484805 has been marked as a duplicate of this bug. ***
I'm not familiar with the KDE PIM code base, but after digging into it I might have a lead. `MessageList::Core::Manager` - which has singleton characteristics - holds a `MessageCore::DateFormatter` object in a member variable named `mDateFormatter`: https://invent.kde.org/pim/messagelib/-/blob/46b22c6d85a63ae70f6822078b4846ec548d70cc/messagelist/src/core/manager.cpp#L33 `MessageCore::DateFormatterPrivate` has a member variable named `mTodayOneSecondBeforeMidnight`, which holds the reference time point for 'today' (and, by extension, for 'yesterday'). That variable is initialised lazily exactly once: https://invent.kde.org/pim/messagelib/-/blob/46b22c6d85a63ae70f6822078b4846ec548d70cc/messagecore/src/utils/dateformatter.cpp#L161 So, in summary, we have a singleton object holding a long-lived date-formatter object containing a reference time point that never gets updated over the lifetime of the application.
Draft fix, currently untested: https://invent.kde.org/pim/messagelib/-/merge_requests/246
A possibly relevant merge request was started @ https://invent.kde.org/pim/messagelib/-/merge_requests/247