@@ -144,15 +144,33 @@ function formatRangeToParts(a, b) {
144144
145145function amend ( options = { } , amended = { } ) {
146146 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+ ] ) {
148159 options [ opt ] = opt in amended ? amended [ opt ] : options [ opt ] ;
149160 if ( options [ opt ] === false || options [ opt ] === undefined ) delete options [ opt ] ;
150161 }
151162 return options ;
152163}
153164
154165function 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+ } ) ;
156174 if ( ! hasTimeOptions ( options ) ) {
157175 options = ObjectAssign ( { } , options , {
158176 hour : 'numeric' ,
@@ -170,7 +188,9 @@ function yearMonthAmend(options) {
170188 minute : false ,
171189 second : false ,
172190 weekday : false ,
173- timeZoneName : false
191+ timeZoneName : false ,
192+ dateStyle : false ,
193+ timeStyle : false
174194 } ) ;
175195 if ( ! ( 'year' in options || 'month' in options ) ) {
176196 options = ObjectAssign ( options , { year : 'numeric' , month : 'numeric' } ) ;
@@ -185,7 +205,9 @@ function monthDayAmend(options) {
185205 minute : false ,
186206 second : false ,
187207 weekday : false ,
188- timeZoneName : false
208+ timeZoneName : false ,
209+ dateStyle : false ,
210+ timeStyle : false
189211 } ) ;
190212 if ( ! ( 'month' in options || 'day' in options ) ) {
191213 options = ObjectAssign ( { } , options , { month : 'numeric' , day : 'numeric' } ) ;
@@ -194,7 +216,13 @@ function monthDayAmend(options) {
194216}
195217
196218function 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+ } ) ;
198226 if ( ! hasDateOptions ( options ) ) {
199227 options = ObjectAssign ( { } , options , {
200228 year : 'numeric' ,
@@ -250,11 +278,11 @@ function instantAmend(options) {
250278}
251279
252280function 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 ;
254282}
255283
256284function 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 ;
258286}
259287
260288function isTemporalObject ( obj ) {
0 commit comments