diff --git a/core/common/src/ArbitraryPrecisionDate.kt b/core/common/src/ArbitraryPrecisionDate.kt new file mode 100644 index 000000000..68f37b244 --- /dev/null +++ b/core/common/src/ArbitraryPrecisionDate.kt @@ -0,0 +1,13 @@ +package kotlinx.datetime + +public sealed interface ArbitraryPrecisionDate : Comparable { + + public val year: Int + + public companion object { + + public fun parse(value: String): ArbitraryPrecisionDate { + TODO() + } + } +} diff --git a/core/common/src/Year.kt b/core/common/src/Year.kt new file mode 100644 index 000000000..ff465c606 --- /dev/null +++ b/core/common/src/Year.kt @@ -0,0 +1,7 @@ +package kotlinx.datetime + +public data class Year(override val year: Int) : ArbitraryPrecisionDate { + + override fun compareTo(other: ArbitraryPrecisionDate): Int = + year.compareTo(other.year) +} diff --git a/core/common/src/YearMonth.kt b/core/common/src/YearMonth.kt new file mode 100644 index 000000000..5f1352999 --- /dev/null +++ b/core/common/src/YearMonth.kt @@ -0,0 +1,8 @@ +package kotlinx.datetime + +public data class YearMonth(override val year: Int, public val month: Month) : ArbitraryPrecisionDate { + + override fun compareTo(other: ArbitraryPrecisionDate): Int { + TODO("Not yet implemented") + } +}