mirror of
https://github.com/etesync/android
synced 2024-11-22 07:58:09 +00:00
Fix issue with journal preview showing the wrong dates.
This commit is contained in:
parent
da3ac48bbf
commit
5fc26c6461
@ -528,9 +528,15 @@ class JournalItemActivity : BaseActivity(), Refreshable {
|
|||||||
if (allDay) {
|
if (allDay) {
|
||||||
// For multi-day allday events or single-day all-day events that are not
|
// For multi-day allday events or single-day all-day events that are not
|
||||||
// today or tomorrow, use framework formatter.
|
// 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())
|
val f = Formatter(StringBuilder(50), Locale.getDefault())
|
||||||
datetimeString = DateUtils.formatDateRange(context, f, startMillis,
|
datetimeString = DateUtils.formatDateRange(context, f, startMillis,
|
||||||
endMillis, flagsDate).toString()
|
adjustedEnd, flagsDate).toString()
|
||||||
} else {
|
} else {
|
||||||
// For multiday events, shorten day/month names.
|
// For multiday events, shorten day/month names.
|
||||||
// Example format: "Fri Apr 6, 5:00pm - Sun, Apr 8, 6:00pm"
|
// Example format: "Fri Apr 6, 5:00pm - Sun, Apr 8, 6:00pm"
|
||||||
|
Loading…
Reference in New Issue
Block a user