Skip to content

Commit

Permalink
Minor fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
kizitonwose committed Dec 9, 2019
1 parent b9e8431 commit d137e3e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ internal data class MonthConfig(
if (currentMonth != endMonth) currentMonth = currentMonth.next else break
}

// Regroup data into 7 days. Use toMutableList() to create a copy of the ephemeral list.
val allDaysGroup = allDays.chunked(7).toMutableList()
// Regroup data into 7 days. Use toList() to create a copy of the ephemeral list.
val allDaysGroup = allDays.chunked(7).toList()

val calendarMonths = mutableListOf<CalendarMonth>()
val calMonthsCount = allDaysGroup.size roundDiv maxRowCount
allDaysGroup.chunked(maxRowCount) { curMonthWeeks ->
val monthWeeks = ArrayList(curMonthWeeks)
allDaysGroup.chunked(maxRowCount) { ephemeralMonthWeeks ->
val monthWeeks = ephemeralMonthWeeks.toMutableList()

// Add the outDates for the last row if needed.
if (monthWeeks.last().size < 7 && outDateStyle == OutDateStyle.END_OF_ROW || outDateStyle == OutDateStyle.END_OF_GRID) {
Expand Down

0 comments on commit d137e3e

Please sign in to comment.