Skip to content

Commit d763eb9

Browse files
committed
Cleanup
1 parent 25ced66 commit d763eb9

File tree

6 files changed

+9
-5
lines changed

6 files changed

+9
-5
lines changed

core/common/src/LocalDate.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ import kotlin.internal.*
4848
* [LocalDate] can be constructed directly from its components using the constructor.
4949
* See sample 1.
5050
*
51+
* A non-throwing version of the constructor is the [orNull] function.
52+
*
5153
* [fromEpochDays] can be used to obtain a [LocalDate] from the number of days since the epoch day `1970-01-01`;
5254
* [toEpochDays] is the inverse operation.
5355
* See sample 2.
@@ -107,6 +109,7 @@ public expect class LocalDate : Comparable<LocalDate> {
107109
* @sample kotlinx.datetime.test.samples.LocalDateSamples.orNull
108110
*/
109111
public fun orNull(year: Int, month: Month, day: Int): LocalDate?
112+
110113
/**
111114
* A shortcut for calling [DateTimeFormat.parse].
112115
*

core/common/src/LocalDateTime.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ import kotlin.jvm.JvmName
8787
* [LocalDateTime] can be constructed directly from its components, [LocalDate] and [LocalTime], using the constructor.
8888
* See sample 1.
8989
*
90+
* A non-throwing version of the constructor is the [orNull] function.
91+
*
9092
* Some additional constructors that directly accept the values from date and time fields are provided for convenience.
9193
* See sample 2.
9294
*
@@ -174,7 +176,6 @@ public expect class LocalDateTime : Comparable<LocalDateTime> {
174176
nanosecond: Int = 0
175177
): LocalDateTime?
176178

177-
178179
/**
179180
* A shortcut for calling [DateTimeFormat.parse].
180181
*

core/common/src/LocalTime.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ import kotlin.jvm.JvmName
5858
*
5959
* [LocalTime] can be constructed directly from its components using the constructor. See sample 1.
6060
*
61+
* A non-throwing version of the constructor is the [orNull] function.
62+
*
6163
* [fromSecondOfDay], [fromMillisecondOfDay], and [fromNanosecondOfDay] can be used to obtain a [LocalTime] from the
6264
* number of seconds, milliseconds, or nanoseconds since the start of the day, assuming that the offset from the UTC
6365
* does not change during the day.
@@ -83,7 +85,6 @@ import kotlin.jvm.JvmName
8385
@Serializable(LocalTimeSerializer::class)
8486
public expect class LocalTime : Comparable<LocalTime> {
8587
public companion object {
86-
8788
/**
8889
* Constructs a [LocalTime] instance from the given time components
8990
* or returns `null` if a value is out of range.

core/common/src/UtcOffset.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ import kotlinx.serialization.Serializable
3838
* [totalSeconds] returns the number of seconds from UTC.
3939
* See sample 1.
4040
*
41+
* A non-throwing version of the constructor is the [orNull] function.
42+
*
4143
* There is also a [ZERO] constant for the offset of zero.
4244
*
4345
* [parse] and [toString] methods can be used to obtain a [UtcOffset] from and convert it to a string in the

core/common/test/samples/LocalDateTimeSamples.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ class LocalDateTimeSamples {
208208
check(LocalDateTime.orNull(2024, Month.FEBRUARY, 15, 24, 48) == null) // Invalid hour
209209
}
210210

211-
212211
@Test
213212
fun formatting() {
214213
// Formatting LocalDateTime values using predefined and custom formats

core/commonKotlin/src/LocalDate.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ public actual class LocalDate private constructor(
181181
// org.threeten.bp.LocalDate#resolvePreviousValid
182182
/**
183183
* May only be called if the year and month are valid.
184-
*
185-
* @throws IllegalArgumentException if the result exceeds the boundaries
186184
*/
187185
private fun resolvePreviousValid(year: Int, month: Int, day: Int): LocalDate {
188186
val newDay = min(day, month.monthLength(isLeapYear(year)))

0 commit comments

Comments
 (0)