diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetMonthlyProvider.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetMonthlyProvider.kt index a4dfe3dd1..9bf4c04a2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetMonthlyProvider.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetMonthlyProvider.kt @@ -15,6 +15,7 @@ import com.simplemobiletools.calendar.pro.extensions.config import com.simplemobiletools.calendar.pro.extensions.launchNewEventIntent import com.simplemobiletools.calendar.pro.interfaces.MonthlyCalendar import com.simplemobiletools.calendar.pro.models.DayMonthly +import com.simplemobiletools.calendar.pro.models.Event import com.simplemobiletools.commons.extensions.* import org.joda.time.DateTime @@ -121,6 +122,9 @@ class MyWidgetMonthlyProvider : AppWidgetProvider() { addDayNumber(context, views, day, currTextColor, id) setupDayOpenIntent(context, views, id, day.code) + day.dayEvents = day.dayEvents.asSequence().sortedWith(compareBy({ it.flags and FLAG_ALL_DAY == 0 }, { it.startTS }, { it.title })) + .toMutableList() as ArrayList + day.dayEvents.forEach { var backgroundColor = it.color var eventTextColor = backgroundColor.getContrastColor()