coerceDate

fun coerceDate(date: LocalDate): LocalDate

Returns the closest selectable date for date.

Candidate dates are compared as whole LocalDate values instead of independently coercing year, month, and day. If two dates are equally close, the earlier date is returned.

Throws

if the configured item lists are empty, contain duplicates, contain values outside their supported ranges, or cannot provide at least one valid day for every selectable year/month combination.


fun coerceDate(year: Int, month: Int, day: Int): LocalDate

Returns the closest selectable date for year, month, and day.

If day is greater than the maximum day for year and month, it is clamped before applying this item's selectable values and date bounds.

Throws

if year or month is outside the supported range, if day is less than 1, or if the configured item lists are invalid.