diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt index af6b1a6c1..ae44730ba 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt @@ -197,14 +197,14 @@ class WeekFragment : Fragment(), WeeklyCalendar { mView.week_events_columns_holder.removeAllViews() (0 until config.weeklyViewDays).forEach { val column = inflater.inflate(R.layout.weekly_view_day_column, mView.week_events_columns_holder, false) as RelativeLayout - column.tag = Formatter.getDayCodeFromTS(weekTimestamp + it * DAY_SECONDS) + column.tag = Formatter.getUTCDayCodeFromTS(weekTimestamp + it * DAY_SECONDS) mView.week_events_columns_holder.addView(column) dayColumns.add(column) } } private fun setupDayLabels() { - var curDay = Formatter.getDateTimeFromTS(weekTimestamp) + var curDay = Formatter.getUTCDateTimeFromTS(weekTimestamp) val textColor = if (isPrintVersion) resources.getColor(R.color.theme_light_text_color) else config.textColor val todayCode = Formatter.getDayCodeFromDateTime(DateTime()) val screenWidth = context?.usableScreenSize?.x ?: return diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Formatter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Formatter.kt index e24ffcf82..23cdef3de 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Formatter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Formatter.kt @@ -108,5 +108,7 @@ object Formatter { } } + fun getUTCDayCodeFromTS(ts: Long) = getUTCDateTimeFromTS(ts).toString(DAYCODE_PATTERN) + fun getShiftedImportTimestamp(ts: Long) = getUTCDateTimeFromTS(ts).withTime(13, 0, 0, 0).withZoneRetainFields(DateTimeZone.getDefault()).seconds() }