Skip to content

Commit c96d955

Browse files
committed
Address the reviews
1 parent 4801426 commit c96d955

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

core/common/src/Clock.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public interface Clock {
2222
* Returns the [Instant] corresponding to the current time, according to this clock.
2323
*
2424
* It is not guaranteed that calling [now] later will return a larger [Instant].
25-
* In particular, for [System] it is completely expected that the opposite will happen,
25+
* In particular, for [Clock.System] it is completely expected that the opposite will happen,
2626
* and it must be taken into account.
27-
* See the documentation of [System] for details.
27+
* See the documentation of [Clock.System] for details.
2828
*
2929
* Even though [Instant] is defined to be on the UTC-SLS time scale, which enforces a specific way of handling
3030
* leap seconds, [now] is not guaranteed to handle leap seconds in any specific way.
@@ -54,6 +54,7 @@ public interface Clock {
5454
override fun now(): Instant = @Suppress("DEPRECATION_ERROR") Instant.now()
5555
}
5656

57+
/** A companion object used purely for namespacing. */
5758
public companion object {
5859

5960
}

core/common/src/DateTimePeriod.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import kotlinx.serialization.Serializable
2222
* The time components are: [hours] ([DateTimeUnit.HOUR]), [minutes] ([DateTimeUnit.MINUTE]),
2323
* [seconds] ([DateTimeUnit.SECOND]), [nanoseconds] ([DateTimeUnit.NANOSECOND]).
2424
*
25-
* The time components are not independent and always overflow into one another.
26-
* Likewise, months overflow into years.
25+
* The time components are not independent and are always normalized together.
26+
* Likewise, months are normalized together with years.
2727
* For example, there is no difference between `DateTimePeriod(months = 24, hours = 2, minutes = 63)` and
2828
* `DateTimePeriod(years = 2, hours = 3, minutes = 3)`.
2929
*
@@ -73,10 +73,10 @@ public sealed class DateTimePeriod {
7373
internal abstract val totalMonths: Int
7474

7575
/**
76-
* The number of calendar days.
76+
* The number of calendar days. Can be negative.
7777
*
7878
* Note that a calendar day is not identical to 24 hours, see [DateTimeUnit.DayBased] for details.
79-
* Also, this field does not overflow into months, so values larger than 31 can be present.
79+
* Also, this field does not get normalized together with months, so values larger than 31 can be present.
8080
*
8181
* @sample kotlinx.datetime.test.samples.DateTimePeriodSamples.valueNormalization
8282
*/
@@ -100,7 +100,7 @@ public sealed class DateTimePeriod {
100100
/**
101101
* The number of whole hours in this period. Can be negative.
102102
*
103-
* This field does not overflow into days, so values larger than 23 or smaller than -23 can be present.
103+
* This field does not get normalized together with days, so values larger than 23 or smaller than -23 can be present.
104104
*
105105
* @sample kotlinx.datetime.test.samples.DateTimePeriodSamples.valueNormalization
106106
*/
@@ -210,7 +210,6 @@ public sealed class DateTimePeriod {
210210
* - Optionally, the number of years, followed by `Y`.
211211
* - Optionally, the number of months, followed by `M`.
212212
* - Optionally, the number of weeks, followed by `W`.
213-
* This is not a part of the ISO 8601 format but an extension.
214213
* - Optionally, the number of days, followed by `D`.
215214
* - The string can end here if there are no more time components.
216215
* If there are time components, the letter `T` is required.

core/common/src/TimeZone.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ public expect open class TimeZone {
6565
/**
6666
* Returns the time zone with the fixed UTC+0 offset.
6767
*
68+
* The [id] of this time zone is `"UTC"`.
69+
*
6870
* @sample kotlinx.datetime.test.samples.TimeZoneSamples.utc
6971
*/
7072
public val UTC: FixedOffsetTimeZone

core/common/src/format/DateTimeFormat.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ import kotlinx.datetime.internal.format.parser.*
1111

1212
/**
1313
* A format for parsing and formatting date-time-related values.
14+
*
15+
* By convention, predefined formats for each applicable class can be found in the `Formats` object of the class, and
16+
* custom formats can be created using the `Format` function in the companion object of that class.
17+
* For example, [LocalDate.Formats] contains predefined formats for [LocalDate], and [LocalDate.Format] can be used
18+
* to define new ones.
1419
*/
1520
public sealed interface DateTimeFormat<T> {
1621
/**

0 commit comments

Comments
 (0)