Use proper day of month to calculate start index in week

Broke during view-binding migration
This commit is contained in:
Naveen 2023-09-27 23:57:37 +05:30
parent d2e59c2c66
commit 3876952f44
No known key found for this signature in database
GPG Key ID: 0E155DAD31671DA3
1 changed files with 2 additions and 1 deletions

View File

@ -104,7 +104,8 @@ class YearFragment : Fragment(), YearlyCalendar {
}
monthHolder.monthLabel.setTextColor(curTextColor)
monthView.firstDay = requireContext().getProperDayIndexInWeek(dateTime.withMonthOfYear(monthOfYear))
val firstDayOfMonth = dateTime.withMonthOfYear(monthOfYear).withDayOfMonth(1)
monthView.firstDay = requireContext().getProperDayIndexInWeek(firstDayOfMonth)
val numberOfDays = dateTime.withMonthOfYear(monthOfYear).dayOfMonth().maximumValue
monthView.setDays(numberOfDays)
monthView.setOnClickListener {