Skip to content

Commit 72fa04f

Browse files
committed
Add Kdocs
1 parent 4e1aab0 commit 72fa04f

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/time/DateTimeFormats.kt

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@ import kotlinx.datetime.format.alternativeParsing
1414
import kotlinx.datetime.format.char
1515
import kotlinx.datetime.format.optional
1616

17+
/**
18+
* [DateTimeFormat<DateTimeComponents>] for use with [kotlinx.datetime.Instant]
19+
*/
1720
internal object DateTimeFormats {
18-
// e.g. "2020-11-05T19:22:37+00:00"
21+
22+
/**
23+
* ISO8601, full precision. Corresponds to [TimestampFormat.ISO_8601_FULL]. Truncate to microseconds for [TimestampFormat.ISO_8601].
24+
* e.g. "2020-11-05T19:22:37+00:00"
25+
*/
1926
val ISO_8601 = DateTimeComponents.Format {
2027
// Two possible date formats: YYYY-MM-DD or YYYYMMDD
2128
alternativeParsing({
@@ -53,10 +60,10 @@ internal object DateTimeFormats {
5360
second()
5461
}
5562

56-
// Fractional seconds (up to 6 digits)
63+
// Fractional seconds
5764
optional {
5865
char('.')
59-
secondFraction(1, 6)
66+
secondFraction(1, 9)
6067
}
6168

6269
// Offsets
@@ -67,6 +74,9 @@ internal object DateTimeFormats {
6774
}
6875
}
6976

77+
/**
78+
* ISO8601 condensed. Corresponds to [TimestampFormat.ISO_8601_CONDENSED].
79+
*/
7080
val ISO_8601_CONDENSED = DateTimeComponents.Format {
7181
year()
7282
monthNumber()
@@ -79,13 +89,19 @@ internal object DateTimeFormats {
7989
char('Z')
8090
}
8191

92+
/**
93+
* ISO8601 condensed, date only. Corresponds to [TimestampFormat.ISO_8601_CONDENSED_DATE]
94+
*/
8295
val ISO_8601_CONDENSED_DATE = DateTimeComponents.Format {
8396
year()
8497
monthNumber()
8598
dayOfMonth()
8699
}
87100

88-
// e.g. "Thu, 05 Nov 2020 19:22:37 +0000"
101+
/**
102+
* [RFC-5322/2822/822 IMF timestamp](https://tools.ietf.org/html/rfc5322). Corresponds to [TimestampFormat.RFC_5322].
103+
* e.g. "Thu, 05 Nov 2020 19:22:37 +0000"
104+
*/
89105
val RFC_5322 = DateTimeComponents.Format {
90106
dayOfWeek(DayOfWeekNames.ENGLISH_ABBREVIATED)
91107
chars(", ")

0 commit comments

Comments
 (0)