Highlight proper week day in month view

This commit is contained in:
Naveen 2023-07-23 23:54:37 +05:30
parent 59aec074fb
commit 7e6ea16dfc
No known key found for this signature in database
GPG Key ID: 0E155DAD31671DA3
1 changed files with 2 additions and 10 deletions

View File

@ -8,10 +8,7 @@ import android.util.AttributeSet
import android.util.SparseIntArray import android.util.SparseIntArray
import android.view.View import android.view.View
import com.simplemobiletools.calendar.pro.R import com.simplemobiletools.calendar.pro.R
import com.simplemobiletools.calendar.pro.extensions.config import com.simplemobiletools.calendar.pro.extensions.*
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.helpers.COLUMN_COUNT import com.simplemobiletools.calendar.pro.helpers.COLUMN_COUNT
import com.simplemobiletools.calendar.pro.helpers.Formatter import com.simplemobiletools.calendar.pro.helpers.Formatter
import com.simplemobiletools.calendar.pro.helpers.ROW_COUNT import com.simplemobiletools.calendar.pro.helpers.ROW_COUNT
@ -403,12 +400,7 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con
return return
} }
currDayOfWeek = DateTime().dayOfWeek currDayOfWeek = context.getProperDayIndexInWeek(DateTime())
if (config.isSundayFirst) {
currDayOfWeek %= 7
} else {
currDayOfWeek--
}
} }
// take into account cases when an event starts on the previous screen, subtract those days // take into account cases when an event starts on the previous screen, subtract those days