1
0
mirror of https://github.com/etesync/android synced 2024-11-14 03:39:52 +00:00

Fix issue with journal preview showing the wrong dates.

This commit is contained in:
Tom Hacohen 2019-11-21 18:56:40 +02:00
parent da3ac48bbf
commit 5fc26c6461

View File

@ -528,9 +528,15 @@ class JournalItemActivity : BaseActivity(), Refreshable {
if (allDay) {
// For multi-day allday events or single-day all-day events that are not
// today or tomorrow, use framework formatter.
// We need to remove 24hrs because full day events are from the start of a day until the start of the next
var adjustedEnd = endMillis - 24 * 60 * 60 * 1000;
if (adjustedEnd < startMillis) {
adjustedEnd = startMillis;
}
val f = Formatter(StringBuilder(50), Locale.getDefault())
datetimeString = DateUtils.formatDateRange(context, f, startMillis,
endMillis, flagsDate).toString()
adjustedEnd, flagsDate).toString()
} else {
// For multiday events, shorten day/month names.
// Example format: "Fri Apr 6, 5:00pm - Sun, Apr 8, 6:00pm"