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

View File

@@ -104,7 +104,8 @@ class YearFragment : Fragment(), YearlyCalendar {
} }
monthHolder.monthLabel.setTextColor(curTextColor) 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 val numberOfDays = dateTime.withMonthOfYear(monthOfYear).dayOfMonth().maximumValue
monthView.setDays(numberOfDays) monthView.setDays(numberOfDays)
monthView.setOnClickListener { monthView.setOnClickListener {