From 7e6ea16dfc9d8aed6ebbf783d58b38500d81f9a4 Mon Sep 17 00:00:00 2001 From: Naveen Date: Sun, 23 Jul 2023 23:54:37 +0530 Subject: [PATCH] Highlight proper week day in month view --- .../calendar/pro/views/MonthView.kt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt index 7b1286d4e..4d0e8899f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt @@ -8,10 +8,7 @@ import android.util.AttributeSet import android.util.SparseIntArray import android.view.View import com.simplemobiletools.calendar.pro.R -import com.simplemobiletools.calendar.pro.extensions.config -import com.simplemobiletools.calendar.pro.extensions.isWeekendIndex -import com.simplemobiletools.calendar.pro.extensions.seconds -import com.simplemobiletools.calendar.pro.extensions.withFirstDayOfWeekToFront +import com.simplemobiletools.calendar.pro.extensions.* import com.simplemobiletools.calendar.pro.helpers.COLUMN_COUNT import com.simplemobiletools.calendar.pro.helpers.Formatter import com.simplemobiletools.calendar.pro.helpers.ROW_COUNT @@ -403,12 +400,7 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con return } - currDayOfWeek = DateTime().dayOfWeek - if (config.isSundayFirst) { - currDayOfWeek %= 7 - } else { - currDayOfWeek-- - } + currDayOfWeek = context.getProperDayIndexInWeek(DateTime()) } // take into account cases when an event starts on the previous screen, subtract those days