kizitonwose / Calendar

A highly customizable calendar view and compose library for Android and Kotlin Multiplatform.
MIT License
4.76k stars 509 forks source link

Implement comparator interface for CalendarDay #444

Closed ghost closed 1 year ago

ghost commented 1 year ago

Feature

To add the CalendarDay object in a TreeSet, the Comparator interface implementation is required. Please implement this interface on CalendarDay object, based on LocalDate comparison.

kizitonwose commented 1 year ago

Why not use the TreeSet constructor that allows you to provide a comparator:

val set = TreeSet<CalendarDay> { d1, d2 ->
    d1.date.compareTo(d2.date)
}
kizitonwose commented 1 year ago

Closing this as it is not necessary to implement it in the library.