Skip to content

Instantly share code, notes, and snippets.

@renanboni
Created April 17, 2024 12:09
Show Gist options
  • Save renanboni/7acd2792619993b501ada61d84375ed0 to your computer and use it in GitHub Desktop.
Save renanboni/7acd2792619993b501ada61d84375ed0 to your computer and use it in GitHub Desktop.
private const val REVIEW_ITEMS_COUNT = 10
fun List<MyVocabListItemModel>.getNextSession(
dateHelpers: DateHelpers
): List<MyVocabListItemModel> {
return filter { it -> it.lastReviewAt?.let { dateHelpers.isToday(it) } == false }
.ifEmpty { sortedBy { it.lastReviewAt } }
.take(REVIEW_ITEMS_COUNT)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment