refactor attempt 2

This commit is contained in:
Doozy 2022-07-02 00:04:45 +03:00
parent 6d1eddb6cd
commit 3ffb88330c
1 changed files with 4 additions and 2 deletions

View File

@ -93,10 +93,12 @@ class DayEventsAdapter(activity: SimpleActivity, val events: ArrayList<Event>, r
if (event.startTS != event.endTS && !event.getIsAllDay()) { if (event.startTS != event.endTS && !event.getIsAllDay()) {
val startDayCode = Formatter.getDayCodeFromTS(event.startTS) val startDayCode = Formatter.getDayCodeFromTS(event.startTS)
val endDayCode = Formatter.getDayCodeFromTS(event.endTS) val endDayCode = Formatter.getDayCodeFromTS(event.endTS)
val startDate = Formatter.getDayTitle(activity, startDayCode,false)
val endDate = Formatter.getDayTitle(activity, endDayCode,false)
val startTimeString = event_item_time.text val startTimeString = event_item_time.text
val startDayString = if (startDayCode != dayCode) "(${Formatter.getDayTitle(activity, startDayCode,false)})" else ""
val endTimeString = Formatter.getTimeFromTS(context, event.endTS) val endTimeString = Formatter.getTimeFromTS(context, event.endTS)
val endDayString = if (endDayCode != dayCode) "(${Formatter.getDayTitle(activity, endDayCode,false)})" else "" val startDayString = if (startDayCode != dayCode) "($startDate)" else ""
val endDayString = if (endDayCode != dayCode) "($endDate)" else ""
event_item_time.text = "$startTimeString$startDayString - $endTimeString$endDayString" event_item_time.text = "$startTimeString$startDayString - $endTimeString$endDayString"
} }