Skip to content

Commit

Permalink
Fixed InCorrect Month Progression Bug (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndroidJunior9 authored Jan 3, 2024
1 parent 794889a commit 285a8f1
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ class KalendarPagingSource(
val page = params.key ?: today.year

// Filter out the months before the current month and year
val kalendarItems = kalendarRepository.generateDates(page)
.filter { date ->
date.year >= today.year && date.month.value >= today.monthNumber
val kalendarItems = kalendarRepository.generateDates(page).filter { date ->
if (date.year == today.year) {
date.month.value >= today.monthNumber
} else {
date.year > today.year
}
}


val nextPage = page.plus(1)

Expand Down

0 comments on commit 285a8f1

Please sign in to comment.