@@ -24,9 +24,9 @@ public sealed interface DateTimeFormatBuilder {
24
24
public fun chars (value : String )
25
25
26
26
/* *
27
- * Functions specific to the datetime format builders containing the local-date fields.
27
+ * Functions specific to the datetime format builders containing the year and month fields.
28
28
*/
29
- public sealed interface WithDate : DateTimeFormatBuilder {
29
+ public sealed interface WithYearMonth : DateTimeFormatBuilder {
30
30
/* *
31
31
* A year number.
32
32
*
@@ -35,7 +35,7 @@ public sealed interface DateTimeFormatBuilder {
35
35
* For years outside this range, it's formatted as a decimal number with a leading sign, so the year 12345
36
36
* is formatted as "+12345".
37
37
*
38
- * @sample kotlinx.datetime.test.samples.format.LocalDateFormatSamples .year
38
+ * @sample kotlinx.datetime.test.samples.format.YearMonthFormatSamples .year
39
39
*/
40
40
public fun year (padding : Padding = Padding .ZERO )
41
41
@@ -54,7 +54,7 @@ public sealed interface DateTimeFormatBuilder {
54
54
* and when given a full year number with a leading sign, it parses the full year number,
55
55
* so "+1850" becomes 1850.
56
56
*
57
- * @sample kotlinx.datetime.test.samples.format.LocalDateFormatSamples .yearTwoDigits
57
+ * @sample kotlinx.datetime.test.samples.format.YearMonthFormatSamples .yearTwoDigits
58
58
*/
59
59
public fun yearTwoDigits (baseYear : Int )
60
60
@@ -63,17 +63,29 @@ public sealed interface DateTimeFormatBuilder {
63
63
*
64
64
* By default, it's padded with zeros to two digits. This can be changed by passing [padding].
65
65
*
66
- * @sample kotlinx.datetime.test.samples.format.LocalDateFormatSamples .monthNumber
66
+ * @sample kotlinx.datetime.test.samples.format.YearMonthFormatSamples .monthNumber
67
67
*/
68
68
public fun monthNumber (padding : Padding = Padding .ZERO )
69
69
70
70
/* *
71
71
* A month name (for example, "January").
72
72
*
73
- * @sample kotlinx.datetime.test.samples.format.LocalDateFormatSamples .monthName
73
+ * @sample kotlinx.datetime.test.samples.format.YearMonthFormatSamples .monthName
74
74
*/
75
75
public fun monthName (names : MonthNames )
76
76
77
+ /* *
78
+ * An existing [DateTimeFormat] for the date part.
79
+ *
80
+ * @sample kotlinx.datetime.test.samples.format.YearMonthFormatSamples.yearMonth
81
+ */
82
+ public fun yearMonth (format : DateTimeFormat <YearMonth >)
83
+ }
84
+
85
+ /* *
86
+ * Functions specific to the datetime format builders containing the local-date fields.
87
+ */
88
+ public sealed interface WithDate : WithYearMonth {
77
89
/* *
78
90
* A day-of-month number, from 1 to 31.
79
91
*
0 commit comments