@@ -144,15 +144,33 @@ function formatRangeToParts(a, b) {
144
144
145
145
function amend ( options = { } , amended = { } ) {
146
146
options = ObjectAssign ( { } , options ) ;
147
- for ( let opt of [ 'year' , 'month' , 'day' , 'hour' , 'minute' , 'second' , 'weekday' , 'timeZoneName' ] ) {
147
+ for ( let opt of [
148
+ 'year' ,
149
+ 'month' ,
150
+ 'day' ,
151
+ 'hour' ,
152
+ 'minute' ,
153
+ 'second' ,
154
+ 'weekday' ,
155
+ 'timeZoneName' ,
156
+ 'dateStyle' ,
157
+ 'timeStyle'
158
+ ] ) {
148
159
options [ opt ] = opt in amended ? amended [ opt ] : options [ opt ] ;
149
160
if ( options [ opt ] === false || options [ opt ] === undefined ) delete options [ opt ] ;
150
161
}
151
162
return options ;
152
163
}
153
164
154
165
function timeAmend ( options ) {
155
- options = amend ( options , { year : false , month : false , day : false , weekday : false , timeZoneName : false } ) ;
166
+ options = amend ( options , {
167
+ year : false ,
168
+ month : false ,
169
+ day : false ,
170
+ weekday : false ,
171
+ timeZoneName : false ,
172
+ dateStyle : false
173
+ } ) ;
156
174
if ( ! hasTimeOptions ( options ) ) {
157
175
options = ObjectAssign ( { } , options , {
158
176
hour : 'numeric' ,
@@ -170,7 +188,9 @@ function yearMonthAmend(options) {
170
188
minute : false ,
171
189
second : false ,
172
190
weekday : false ,
173
- timeZoneName : false
191
+ timeZoneName : false ,
192
+ dateStyle : false ,
193
+ timeStyle : false
174
194
} ) ;
175
195
if ( ! ( 'year' in options || 'month' in options ) ) {
176
196
options = ObjectAssign ( options , { year : 'numeric' , month : 'numeric' } ) ;
@@ -185,7 +205,9 @@ function monthDayAmend(options) {
185
205
minute : false ,
186
206
second : false ,
187
207
weekday : false ,
188
- timeZoneName : false
208
+ timeZoneName : false ,
209
+ dateStyle : false ,
210
+ timeStyle : false
189
211
} ) ;
190
212
if ( ! ( 'month' in options || 'day' in options ) ) {
191
213
options = ObjectAssign ( { } , options , { month : 'numeric' , day : 'numeric' } ) ;
@@ -194,7 +216,13 @@ function monthDayAmend(options) {
194
216
}
195
217
196
218
function dateAmend ( options ) {
197
- options = amend ( options , { hour : false , minute : false , second : false , timeZoneName : false } ) ;
219
+ options = amend ( options , {
220
+ hour : false ,
221
+ minute : false ,
222
+ second : false ,
223
+ timeZoneName : false ,
224
+ timeStyle : false
225
+ } ) ;
198
226
if ( ! hasDateOptions ( options ) ) {
199
227
options = ObjectAssign ( { } , options , {
200
228
year : 'numeric' ,
@@ -250,11 +278,11 @@ function instantAmend(options) {
250
278
}
251
279
252
280
function hasDateOptions ( options ) {
253
- return 'year' in options || 'month' in options || 'day' in options || 'weekday' in options ;
281
+ return 'year' in options || 'month' in options || 'day' in options || 'weekday' in options || 'dateStyle' in options ;
254
282
}
255
283
256
284
function hasTimeOptions ( options ) {
257
- return 'hour' in options || 'minute' in options || 'second' in options ;
285
+ return 'hour' in options || 'minute' in options || 'second' in options || 'timeStyle' in options ;
258
286
}
259
287
260
288
function isTemporalObject ( obj ) {
0 commit comments