@@ -106,6 +106,8 @@ public sealed interface DateTimeFormatBuilder {
106
106
* The hour of the day, from 0 to 23.
107
107
*
108
108
* By default, it's zero-padded to two digits, but this can be changed with [padding].
109
+ *
110
+ * @sample kotlinx.datetime.test.samples.format.LocalTimeFormatSamples.hhmmss
109
111
*/
110
112
public fun hour (padding : Padding = Padding .ZERO )
111
113
@@ -122,6 +124,7 @@ public sealed interface DateTimeFormatBuilder {
122
124
* By default, it's zero-padded to two digits, but this can be changed with [padding].
123
125
*
124
126
* @see [amPmMarker]
127
+ * @sample kotlinx.datetime.test.samples.format.LocalTimeFormatSamples.amPm
125
128
*/
126
129
public fun amPmHour (padding : Padding = Padding .ZERO )
127
130
@@ -131,13 +134,16 @@ public sealed interface DateTimeFormatBuilder {
131
134
* [am] is used for the AM marker (0-11 hours), [pm] is used for the PM marker (12-23 hours).
132
135
*
133
136
* @see [amPmHour]
137
+ * @sample kotlinx.datetime.test.samples.format.LocalTimeFormatSamples.amPm
134
138
*/
135
139
public fun amPmMarker (am : String , pm : String )
136
140
137
141
/* *
138
142
* The minute of hour.
139
143
*
140
144
* By default, it's zero-padded to two digits, but this can be changed with [padding].
145
+ *
146
+ * @sample kotlinx.datetime.test.samples.format.LocalTimeFormatSamples.hhmmss
141
147
*/
142
148
public fun minute (padding : Padding = Padding .ZERO )
143
149
@@ -147,6 +153,8 @@ public sealed interface DateTimeFormatBuilder {
147
153
* By default, it's zero-padded to two digits, but this can be changed with [padding].
148
154
*
149
155
* This field has the default value of 0. If you want to omit it, use [optional].
156
+ *
157
+ * @sample kotlinx.datetime.test.samples.format.LocalTimeFormatSamples.hhmmss
150
158
*/
151
159
public fun second (padding : Padding = Padding .ZERO )
152
160
@@ -166,6 +174,8 @@ public sealed interface DateTimeFormatBuilder {
166
174
* part.
167
175
*
168
176
* @throws IllegalArgumentException if [minLength] is greater than [maxLength] or if either is not in the range 1..9.
177
+ *
178
+ * @sample kotlinx.datetime.test.samples.format.LocalTimeFormatSamples.hhmmss
169
179
*/
170
180
public fun secondFraction (minLength : Int = 1, maxLength : Int = 9)
171
181
@@ -186,6 +196,7 @@ public sealed interface DateTimeFormatBuilder {
186
196
* @throws IllegalArgumentException if [fixedLength] is not in the range 1..9.
187
197
*
188
198
* @see secondFraction that accepts two parameters.
199
+ * @sample kotlinx.datetime.test.samples.format.LocalTimeFormatSamples.fixedLengthSecondFraction
189
200
*/
190
201
public fun secondFraction (fixedLength : Int ) {
191
202
secondFraction(fixedLength, fixedLength)
@@ -194,10 +205,7 @@ public sealed interface DateTimeFormatBuilder {
194
205
/* *
195
206
* An existing [DateTimeFormat] for the time part.
196
207
*
197
- * Example:
198
- * ```
199
- * time(LocalTime.Formats.ISO)
200
- * ```
208
+ * @sample kotlinx.datetime.test.samples.format.LocalTimeFormatSamples.time
201
209
*/
202
210
public fun time (format : DateTimeFormat <LocalTime >)
203
211
}
@@ -209,10 +217,7 @@ public sealed interface DateTimeFormatBuilder {
209
217
/* *
210
218
* An existing [DateTimeFormat] for the date-time part.
211
219
*
212
- * Example:
213
- * ```
214
- * dateTime(LocalDateTime.Formats.ISO)
215
- * ```
220
+ * @sample kotlinx.datetime.test.samples.format.LocalDateTimeFormatSamples.dateTime
216
221
*/
217
222
public fun dateTime (format : DateTimeFormat <LocalDateTime >)
218
223
}
@@ -227,6 +232,8 @@ public sealed interface DateTimeFormatBuilder {
227
232
* By default, it's zero-padded to two digits, but this can be changed with [padding].
228
233
*
229
234
* This field has the default value of 0. If you want to omit it, use [optional].
235
+ *
236
+ * @sample kotlinx.datetime.test.samples.format.UtcOffsetFormatSamples.isoOrGmt
230
237
*/
231
238
public fun offsetHours (padding : Padding = Padding .ZERO )
232
239
@@ -236,6 +243,8 @@ public sealed interface DateTimeFormatBuilder {
236
243
* By default, it's zero-padded to two digits, but this can be changed with [padding].
237
244
*
238
245
* This field has the default value of 0. If you want to omit it, use [optional].
246
+ *
247
+ * @sample kotlinx.datetime.test.samples.format.UtcOffsetFormatSamples.isoOrGmt
239
248
*/
240
249
public fun offsetMinutesOfHour (padding : Padding = Padding .ZERO )
241
250
@@ -245,16 +254,15 @@ public sealed interface DateTimeFormatBuilder {
245
254
* By default, it's zero-padded to two digits, but this can be changed with [padding].
246
255
*
247
256
* This field has the default value of 0. If you want to omit it, use [optional].
257
+ *
258
+ * @sample kotlinx.datetime.test.samples.format.UtcOffsetFormatSamples.isoOrGmt
248
259
*/
249
260
public fun offsetSecondsOfMinute (padding : Padding = Padding .ZERO )
250
261
251
262
/* *
252
263
* An existing [DateTimeFormat] for the UTC offset part.
253
264
*
254
- * Example:
255
- * ```
256
- * offset(UtcOffset.Formats.FOUR_DIGITS)
257
- * ```
265
+ * @sample kotlinx.datetime.test.samples.format.UtcOffsetFormatSamples.offset
258
266
*/
259
267
public fun offset (format : DateTimeFormat <UtcOffset >)
260
268
}
@@ -269,16 +277,15 @@ public sealed interface DateTimeFormatBuilder {
269
277
*
270
278
* When formatting, the timezone identifier is supplied as is, without any validation.
271
279
* On parsing, [TimeZone.availableZoneIds] is used to validate the identifier.
280
+ *
281
+ * @sample kotlinx.datetime.test.samples.format.DateTimeComponentsFormatSamples.timeZoneId
272
282
*/
273
283
public fun timeZoneId ()
274
284
275
285
/* *
276
286
* An existing [DateTimeFormat].
277
287
*
278
- * Example:
279
- * ```
280
- * dateTimeComponents(DateTimeComponents.Formats.RFC_1123)
281
- * ```
288
+ * @sample kotlinx.datetime.test.samples.format.DateTimeComponentsFormatSamples.dateTimeComponents
282
289
*/
283
290
public fun dateTimeComponents (format : DateTimeFormat <DateTimeComponents >)
284
291
}
0 commit comments