Fix issue with journal preview showing the wrong dates.

pull/104/head
Tom Hacohen 5 years ago
parent da3ac48bbf
commit 5fc26c6461

@ -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"

Loading…
Cancel
Save