Closed lwelti closed 1 year ago
and I was able to replicate it locally, very simple code:
puts ICU::TimeFormatting.format(Time.mktime(2015, 3, 12, 15, 21, 16), {:locale => 'fi', :zone => 'America/Los_Angeles', :date => :long, :time => :short, :hour_cycle => 'h12'}) puts ICU::TimeFormatting.format(Time.mktime(2015, 3, 12, 15, 21, 16), {:locale => 'fi', :zone => 'America/Los_Angeles', :date => :long, :time => :short, :hour_cycle => 'h24'})
returns:
12. maaliskuuta 2015 hlo 3.21 ip. <--- replaces k with h so it becomes hlo 12. maaliskuuta 2015 klo 15.21
if you compare with Intl.js code:
const date = new Date(Date.UTC(2020, 2, 13, 3, 23, 16, 738)); console.log(new Intl.DateTimeFormat('fi-u-hc-h12', { dateStyle: 'long', timeStyle: 'short', timeZone: 'America/Los_Angeles' }).format(date)); console.log(new Intl.DateTimeFormat('fi-u-hc-h24', { dateStyle: 'long', timeStyle: 'short', timeZone: 'America/Los_Angeles' }).format(date));
> "12. maaliskuuta 2020 klo 8.23 ip." <--- keeps klo > "12. maaliskuuta 2020 klo 20.23"
We believe the issue is on the at replacement, which in this case should respect text inside quotes
at
and I was able to replicate it locally, very simple code:
returns:
if you compare with Intl.js code:
returns:
We believe the issue is on the
at
replacement, which in this case should respect text inside quotes