File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ public interface DateFormatBuilderFields {
15
15
public fun appendMonthNumber (minLength : Int = 1)
16
16
public fun appendMonthName (names : List <String >)
17
17
public fun appendDayOfMonth (minLength : Int = 1)
18
+ public fun appendDayOfWeek (names : List <String >)
18
19
}
19
20
20
21
@DateTimeBuilder
@@ -66,6 +67,8 @@ public class LocalDateFormat private constructor(private val actualFormat: Forma
66
67
actualBuilder.add(BasicFormatStructure (MonthNameDirective (names)))
67
68
68
69
override fun appendDayOfMonth (minLength : Int ) = actualBuilder.add(BasicFormatStructure (DayDirective (minLength)))
70
+ override fun appendDayOfWeek (names : List <String >) =
71
+ actualBuilder.add(BasicFormatStructure (DayOfWeekDirective (names)))
69
72
70
73
override fun createEmpty (): Builder = Builder (actualBuilder.createSibling())
71
74
override fun castToGeneric (actualSelf : Builder ): DateFormatBuilder = this
@@ -163,6 +166,9 @@ internal class MonthNameDirective(names: List<String>) :
163
166
internal class DayDirective (minDigits : Int ) :
164
167
UnsignedIntFieldFormatDirective <DateFieldContainer >(DateFields .dayOfMonth, minDigits)
165
168
169
+ internal class DayOfWeekDirective (names : List <String >) :
170
+ NamedUnsignedIntFieldFormatDirective <DateFieldContainer >(DateFields .isoDayOfWeek, names)
171
+
166
172
internal object DateFormatBuilderSpec: BuilderSpec<DateFieldContainer>(
167
173
mapOf(
168
174
"ld" to DateFormatBuilderSpec
Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ public class LocalDateTimeFormat private constructor(private val actualFormat: F
67
67
override fun appendMonthName (names : List <String >) =
68
68
actualBuilder.add(BasicFormatStructure (MonthNameDirective (names)))
69
69
override fun appendDayOfMonth (minLength : Int ) = actualBuilder.add(BasicFormatStructure (DayDirective (minLength)))
70
+ override fun appendDayOfWeek (names : List <String >) =
71
+ actualBuilder.add(BasicFormatStructure (DayOfWeekDirective (names)))
70
72
override fun appendHour (minLength : Int ) = actualBuilder.add(BasicFormatStructure (HourDirective (minLength)))
71
73
override fun appendAmPmHour (minLength : Int ) =
72
74
actualBuilder.add(BasicFormatStructure (AmPmHourDirective (minLength)))
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ public class ValueBag internal constructor(internal val contents: ValueBagConten
47
47
year = localDate.year
48
48
monthNumber = localDate.monthNumber
49
49
dayOfMonth = localDate.dayOfMonth
50
+ dayOfWeek = localDate.dayOfWeek
50
51
}
51
52
52
53
/* *
@@ -332,6 +333,8 @@ public class ValueBagFormat private constructor(private val actualFormat: Format
332
333
override fun appendMonthName (names : List <String >) =
333
334
actualBuilder.add(BasicFormatStructure (MonthNameDirective (names)))
334
335
override fun appendDayOfMonth (minLength : Int ) = actualBuilder.add(BasicFormatStructure (DayDirective (minLength)))
336
+ override fun appendDayOfWeek (names : List <String >) =
337
+ actualBuilder.add(BasicFormatStructure (DayOfWeekDirective (names)))
335
338
override fun appendHour (minLength : Int ) = actualBuilder.add(BasicFormatStructure (HourDirective (minLength)))
336
339
override fun appendAmPmHour (minLength : Int ) =
337
340
actualBuilder.add(BasicFormatStructure (AmPmHourDirective (minLength)))
You can’t perform that action at this time.
0 commit comments