Merge pull request #2214 from naveensingh/fix_yearly_view

Use proper day of month to calculate start index in week
This commit is contained in:
Tibor Kaputa 2023-09-28 08:56:42 +02:00 committed by GitHub
commit 976d7d1943
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 {