diff --git a/core/common/src/DateTimePeriod.kt b/core/common/src/DateTimePeriod.kt index 03623a1b..bb17289f 100644 --- a/core/common/src/DateTimePeriod.kt +++ b/core/common/src/DateTimePeriod.kt @@ -298,14 +298,9 @@ public sealed class DateTimePeriod { } /** - * Parses the ISO-8601 duration representation as a [DateTimePeriod]. - * - * See [DateTimePeriod.parse] for examples. - * - * @throws IllegalArgumentException if the text cannot be parsed or the boundaries of [DateTimePeriod] are exceeded. - * - * @see DateTimePeriod.parse + * @suppress */ +@Deprecated("Removed to support more idiomatic code. See https://github.com/Kotlin/kotlinx-datetime/issues/339", ReplaceWith("DateTimePeriod.parse(this)"), DeprecationLevel.WARNING) public fun String.toDateTimePeriod(): DateTimePeriod = DateTimePeriod.parse(this) /** @@ -358,16 +353,9 @@ public class DatePeriod internal constructor( } /** - * Parses the ISO-8601 duration representation as a [DatePeriod]. - * - * This function is equivalent to [DateTimePeriod.parse], but will fail if any of the time components are not - * zero. - * - * @throws IllegalArgumentException if the text cannot be parsed, the boundaries of [DatePeriod] are exceeded, - * or any time components are not zero. - * - * @see DateTimePeriod.parse + * @suppress */ +@Deprecated("Removed to support more idiomatic code. See https://github.com/Kotlin/kotlinx-datetime/issues/339", ReplaceWith("DatePeriod.parse(this)"), DeprecationLevel.WARNING) public fun String.toDatePeriod(): DatePeriod = DatePeriod.parse(this) private class DateTimePeriodImpl( diff --git a/core/common/src/Instant.kt b/core/common/src/Instant.kt index bff7fb8c..c3b607c3 100644 --- a/core/common/src/Instant.kt +++ b/core/common/src/Instant.kt @@ -207,13 +207,9 @@ public val Instant.isDistantFuture: Boolean get() = this >= Instant.DISTANT_FUTURE /** - * Converts this string representing an instant in ISO-8601 format including date and time components and - * the time zone offset to an [Instant] value. - * - * See [Instant.parse] for examples of instant string representations and discussion of leap seconds. - * - * @throws IllegalArgumentException if the text cannot be parsed or the boundaries of [Instant] are exceeded. + * @suppress */ +@Deprecated("Removed to support more idiomatic code. See https://github.com/Kotlin/kotlinx-datetime/issues/339", ReplaceWith("Instant.parse(this)"), DeprecationLevel.WARNING) public fun String.toInstant(): Instant = Instant.parse(this) /** diff --git a/core/common/src/LocalDate.kt b/core/common/src/LocalDate.kt index 786d0ec0..dcd622c2 100644 --- a/core/common/src/LocalDate.kt +++ b/core/common/src/LocalDate.kt @@ -192,12 +192,9 @@ public fun LocalDate.Companion.parse(input: CharSequence, format: DateTimeFormat format.parse(input) /** - * Converts this string representing a date in ISO-8601 format to a [LocalDate] value. - * - * See [LocalDate.parse] for examples of local date string representations. - * - * @throws IllegalArgumentException if the text cannot be parsed or the boundaries of [LocalDate] are exceeded. + * @suppress */ +@Deprecated("Removed to support more idiomatic code. See https://github.com/Kotlin/kotlinx-datetime/issues/339", ReplaceWith("LocalDate.parse(this)"), DeprecationLevel.WARNING) public fun String.toLocalDate(): LocalDate = LocalDate.parse(this) /** diff --git a/core/common/src/LocalDateTime.kt b/core/common/src/LocalDateTime.kt index 89e401c3..1807bca8 100644 --- a/core/common/src/LocalDateTime.kt +++ b/core/common/src/LocalDateTime.kt @@ -235,12 +235,8 @@ public fun LocalDateTime.Companion.parse(input: CharSequence, format: DateTimeFo format.parse(input) /** - * Converts this string representing a date/time value in ISO-8601 format including date and time components - * but without any time zone component to a [LocalDateTime] value. - * - * See [LocalDateTime.parse] for examples of date/time string representations. - * - * @throws IllegalArgumentException if the text cannot be parsed or the boundaries of [LocalDateTime] are exceeded. + * @suppress */ +@Deprecated("Removed to support more idiomatic code. See https://github.com/Kotlin/kotlinx-datetime/issues/339", ReplaceWith("LocalDateTime.parse(this)"), DeprecationLevel.WARNING) public fun String.toLocalDateTime(): LocalDateTime = LocalDateTime.parse(this) diff --git a/core/common/src/LocalTime.kt b/core/common/src/LocalTime.kt index f94a5f26..0844180d 100644 --- a/core/common/src/LocalTime.kt +++ b/core/common/src/LocalTime.kt @@ -203,12 +203,9 @@ public fun LocalTime.Companion.parse(input: CharSequence, format: DateTimeFormat format.parse(input) /** - * Converts this string representing a time value in ISO-8601 format to a [LocalTime] value. - * - * See [LocalTime.parse] for examples of time string representations. - * - * @throws IllegalArgumentException if the text cannot be parsed or the boundaries of [LocalTime] are exceeded. + * @suppress */ +@Deprecated("Removed to support more idiomatic code. See https://github.com/Kotlin/kotlinx-datetime/issues/339", ReplaceWith("LocalTime.parse(this)"), DeprecationLevel.WARNING) public fun String.toLocalTime(): LocalTime = LocalTime.parse(this) /**