Closed KJTsanaktsidis closed 2 years ago
@KJTsanaktsidis could you post in the description the different ways to call the API, just to be sure. thanks!
Done - is this what you meant?
yes! thanks @KJTsanaktsidis
and just to be 110% sure :) , is backward compatible, so any previous call such as:
ICU::TimeFormatting.format(t, zone: 'UTC', :locale => 'cs_CZ', :date => :pattern, :time => :pattern, :skeleton => 'MMMMY')
still works right? I guess if not then the test will be failing
Yup! The default value for hour_cycle is :pattern, which short circuits out all of this new logic
The hour cycle can be directly specified to the call to #format, or inferred from an "@hours=" keyword on the locale.
The algorithm for fixing up the skeletons & patterns is the same as that used in Firefox: https://github.com/tc39/ecma402/issues/665#issuecomment-1084833809
There are two main ways to call this API. Either
hour_cycle
can be specified directly, or it can be set to:locale
in which case thehours
keyword in the locale will be used.