develooper Front page | perl.datetime | Postings from February 2021

Surprising results from predefined CLDR formats

Thread Next
From:
BPJ
Date:
February 24, 2021 05:26
Subject:
Surprising results from predefined CLDR formats
Message ID:
CADAJKhC6=xKj_GjMYQUxUau2ZDc2foczU8ddK1UQmASKXXKiZg@mail.gmail.com
Please consider this code:

``````perl
use DateTime;

my $dt = DateTime->now( locale => 'sv' );

for my $fmt ( $dt->locale->available_formats ) {
  my $val = $dt->format_cldr($fmt);
  say "$fmt : $val";
}
``````

Most of the formatted strings seem to be missing some whitespace and have
things in a surprisising order.
E.g. `MMMd` gives `feb.23` where I would have expected `23 feb.`.

I don't know if/what I'm doing wrong, or whether this is a DateTime,
DateTime::Locale or CLDR bug or indeed if it is a bug at all.


-- 
Better --help|less than helpless

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About