@@ -27,20 +27,20 @@ locale: [en, fr, it, ja, zh, ko, ar, hi, en-u-hc-h24]
27
27
let locales = [ "en" , "fr" , "it" , "ja" , "ja-u-hc-h11" , "zh" , "ko" , "ar" , "hi" , "en-u-hc-h24" ] ;
28
28
29
29
locales . forEach ( function ( locale ) {
30
- let hcDefault = new Intl . DateTimeFormat ( locale , { hour : "numeric" } ) . resolvedOptions ( ) . hourCycle ;
31
- if ( hcDefault === "h11" || hcDefault === "h12" ) {
32
- assert . sameValue ( new Intl . DateTimeFormat ( locale , { hour : "numeric" , hour12 : true } ) . resolvedOptions ( ) . hourCycle , hcDefault ) ;
30
+ let hcDefault = new Intl . DateTimeFormat ( locale , { hour : "numeric" } ) . resolvedOptions ( ) . hourCycle ;
31
+ if ( hcDefault === "h11" || hcDefault === "h12" ) {
32
+ assert . sameValue ( new Intl . DateTimeFormat ( locale , { hour : "numeric" , hour12 : true } ) . resolvedOptions ( ) . hourCycle , hcDefault ) ;
33
33
34
34
// no locale has "h24" as a default. see https://github.com/tc39/ecma402/pull/758#issue-1622377292
35
- assert . sameValue ( new Intl . DateTimeFormat ( locale , { hour : "numeric" , hour12 : false } ) . resolvedOptions ( ) . hourCycle , "h23" ) ;
35
+ assert . sameValue ( new Intl . DateTimeFormat ( locale , { hour : "numeric" , hour12 : false } ) . resolvedOptions ( ) . hourCycle , "h23" ) ;
36
36
}
37
37
38
38
// however, "h24" can be set via locale extension.
39
39
if ( hcDefault === "h23" || hcDefault === "h24" ) {
40
- assert . sameValue ( new Intl . DateTimeFormat ( locale , { hour : "numeric" , hour12 : false } ) . resolvedOptions ( ) . hourCycle , hcDefault ) ;
40
+ assert . sameValue ( new Intl . DateTimeFormat ( locale , { hour : "numeric" , hour12 : false } ) . resolvedOptions ( ) . hourCycle , hcDefault ) ;
41
41
}
42
42
43
43
44
- let hcHour12 = new Intl . DateTimeFormat ( locale , { hour : "numeric" , hour12 : true } ) . resolvedOptions ( ) . hourCycle ;
44
+ let hcHour12 = new Intl . DateTimeFormat ( locale , { hour : "numeric" , hour12 : true } ) . resolvedOptions ( ) . hourCycle ;
45
45
assert ( hcHour12 === "h11" || hcHour12 === "h12" , "Expected `hourCycle`: " + hcHour12 + " to be in [\"h11\", \"h12\"]" ) ;
46
46
} ) ;
0 commit comments