File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
core/common/src/format/migration Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -106,22 +106,30 @@ public fun DateTimeFormatBuilder.byUnicodePattern(pattern: String) {
106
106
is UnicodeFormat .Directive -> {
107
107
when (format) {
108
108
is UnicodeFormat .Directive .TimeBased -> {
109
- require(builder is DateTimeFormatBuilder .WithTime )
109
+ require(builder is DateTimeFormatBuilder .WithTime ) {
110
+ " A time-based directive $format was used in a format builder that doesn't support time components"
111
+ }
110
112
format.addToFormat(builder)
111
113
}
112
114
113
115
is UnicodeFormat .Directive .DateBased -> {
114
- require(builder is DateTimeFormatBuilder .WithDate )
116
+ require(builder is DateTimeFormatBuilder .WithDate ) {
117
+ " A date-based directive $format was used in a format builder that doesn't support date components"
118
+ }
115
119
format.addToFormat(builder)
116
120
}
117
121
118
122
is UnicodeFormat .Directive .ZoneBased -> {
119
- require(builder is DateTimeFormatBuilder .WithDateTimeComponents )
123
+ require(builder is DateTimeFormatBuilder .WithDateTimeComponents ) {
124
+ " A time-zone-based directive $format was used in a format builder that doesn't support time-zone components"
125
+ }
120
126
format.addToFormat(builder)
121
127
}
122
128
123
129
is UnicodeFormat .Directive .OffsetBased -> {
124
- require(builder is DateTimeFormatBuilder .WithUtcOffset )
130
+ require(builder is DateTimeFormatBuilder .WithUtcOffset ) {
131
+ " A UTC-offset-based directive $format was used in a format builder that doesn't support UTC offset components"
132
+ }
125
133
format.addToFormat(builder)
126
134
}
127
135
You can’t perform that action at this time.
0 commit comments