Created
April 17, 2024 12:09
-
-
Save renanboni/7acd2792619993b501ada61d84375ed0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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