KvadrantDate

data class KvadrantDate(val year: Int, val month: Int, val day: Int)

A date, as three numbers, because a picker is a control and not a calendar.

kotlinx-datetime was the obvious choice and is not made here. Its LocalDate is exactly this type and is the Kotlin multiplatform standard — but putting it on kvadrant-core's API puts it on every consumer of a Metro button, and a component library is not the right place to decide which date library an application uses. Three integers convert to whatever the caller already has in one line, and only at the one call site that opened a picker.

The arithmetic this costs is daysInMonth and it is five lines of the Gregorian rule.

Parameters

month

1..12, not the zero-based month of the platform calendars this deliberately avoids.

Constructors

Link copied to clipboard
constructor(year: Int, month: Int, day: Int)

Properties

Link copied to clipboard
val day: Int
Link copied to clipboard
val month: Int
Link copied to clipboard
val year: Int