Skip to content

Commit a372015

Browse files
authored
Fix docs mentioning internal class DateTimeFormatException (#87)
Fixes #85
1 parent 3af71d2 commit a372015

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

core/common/src/Instant.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public expect class Instant : Comparable<Instant> {
128128
* - `2020-08-30T18:43:00.500Z`
129129
* - `2020-08-30T18:43:00.123456789Z`
130130
*
131-
* @throws DateTimeFormatException if the text cannot be parsed or the boundaries of [Instant] are exceeded.
131+
* @throws IllegalArgumentException if the text cannot be parsed or the boundaries of [Instant] are exceeded.
132132
*/
133133
fun parse(isoString: String): Instant
134134

@@ -168,7 +168,7 @@ public val Instant.isDistantFuture
168168
*
169169
* See [Instant.parse] for examples of instant string representations.
170170
*
171-
* @throws DateTimeFormatException if the text cannot be parsed or the boundaries of [Instant] are exceeded.
171+
* @throws IllegalArgumentException if the text cannot be parsed or the boundaries of [Instant] are exceeded.
172172
*/
173173
public fun String.toInstant(): Instant = Instant.parse(this)
174174

core/common/src/LocalDate.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public expect class LocalDate : Comparable<LocalDate> {
1313
*
1414
* An example of a local date in ISO-8601 format: `2020-08-30`.
1515
*
16-
* @throws DateTimeFormatException if the text cannot be parsed or the boundaries of [LocalDate] are exceeded.
16+
* @throws IllegalArgumentException if the text cannot be parsed or the boundaries of [LocalDate] are exceeded.
1717
*/
1818
public fun parse(isoString: String): LocalDate
1919

@@ -86,7 +86,7 @@ public expect class LocalDate : Comparable<LocalDate> {
8686
*
8787
* See [LocalDate.parse] for examples of local date string representations.
8888
*
89-
* @throws DateTimeFormatException if the text cannot be parsed or the boundaries of [LocalDate] are exceeded.
89+
* @throws IllegalArgumentException if the text cannot be parsed or the boundaries of [LocalDate] are exceeded.
9090
*/
9191
public fun String.toLocalDate(): LocalDate = LocalDate.parse(this)
9292

@@ -186,7 +186,7 @@ public expect fun LocalDate.daysUntil(other: LocalDate): Int
186186
public expect fun LocalDate.monthsUntil(other: LocalDate): Int
187187

188188
/**
189-
* Returns the number of whole years between two instants in the specified [timeZone].
189+
* Returns the number of whole years between two dates.
190190
*
191191
* If the result does not fit in [Int], returns [Int.MAX_VALUE] for a positive result or [Int.MIN_VALUE] for a negative result.
192192
*

core/common/src/LocalDateTime.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public expect class LocalDateTime : Comparable<LocalDateTime> {
2020
* - `2020-08-30T18:43:00.500`
2121
* - `2020-08-30T18:43:00.123456789`
2222
*
23-
* @throws DateTimeFormatException if the text cannot be parsed or the boundaries of [LocalDateTime] are
23+
* @throws IllegalArgumentException if the text cannot be parsed or the boundaries of [LocalDateTime] are
2424
* exceeded.
2525
*/
2626
public fun parse(isoString: String): LocalDateTime
@@ -113,7 +113,7 @@ public expect class LocalDateTime : Comparable<LocalDateTime> {
113113
*
114114
* See [LocalDateTime.parse] for examples of date/time string representations.
115115
*
116-
* @throws DateTimeFormatException if the text cannot be parsed or the boundaries of [LocalDateTime] are exceeded.
116+
* @throws IllegalArgumentException if the text cannot be parsed or the boundaries of [LocalDateTime] are exceeded.
117117
*/
118118
public fun String.toLocalDateTime(): LocalDateTime = LocalDateTime.parse(this)
119119

0 commit comments

Comments
 (0)