Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DateTime-Locale CPAN distribution.

Report information
The Basics
Id: 49724
Status: resolved
Priority: 0/
Queue: DateTime-Locale

People
Owner: Nobody in particular
Requestors: dmuey [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.43
  • 0.44
Fixed in: (no value)



Subject: format oddity 4 digit year changed to 2 digit year (w/ cldr 1.7.1 ?)
Hello Dave, I know these locale modules are auto generated but it seems fairly odd that a lot (all?) of the formats that used to be 4 digit years are now 2 digit years. perl -MDateTime -MDateTime::Locale -le 'for my $locale(@ARGV) {my $format = DateTime::Locale->load($locale)->long_date_format();print "$locale $format: " . DateTime->now()->strftime($format . " Y == %Y");}' en fr it en %B %{day}, %y: September 15, 09 Y == 2009 fr %{day} %B %y: 15 September 09 Y == 2009 it %d %B %y: 15 September 09 Y == 2009 I noticed some tests failing and it turns out it was because the year was now '78' instead of '1978' cldr_version() 1.6.1 my $date_format_full = "EEEE\,\ MMMM\ d\,\ yyyy"; http://cpansearch.perl.org/src/DROLSKY/DateTime-Locale- 0.42/lib/DateTime/Locale/en.pm cldr_version() 1.7.1 my $date_format_long = "MMMM\ d\,\ y"; http://cpansearch.perl.org/src/DROLSKY/DateTime-Locale- 0.43/lib/DateTime/Locale/en.pm I'm not sure if that was an oversite in CLDR 1.7.1, an suto-generate bug, or it has just changed and that is the way it is but I figured I'd pass it along to the master to decide :) Thanks!
Subject: Re: [rt.cpan.org #49724] format oddity 4 digit year changed to 2 digit year (w/ cldr 1.7.1 ?)
Date: Tue, 15 Sep 2009 17:31:48 -0500 (CDT)
To: Daniel Muey via RT <bug-DateTime-Locale [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Tue, 15 Sep 2009, Daniel Muey via RT wrote: Show quoted text
> I noticed some tests failing and it turns out it was because the year was > now '78' instead of '1978' > > cldr_version() 1.6.1 > my $date_format_full = "EEEE\,\ MMMM\ d\,\ yyyy"; > > http://cpansearch.perl.org/src/DROLSKY/DateTime-Locale- > 0.42/lib/DateTime/Locale/en.pm > > cldr_version() 1.7.1 > my $date_format_long = "MMMM\ d\,\ y"; > http://cpansearch.perl.org/src/DROLSKY/DateTime-Locale- > 0.43/lib/DateTime/Locale/en.pm
Do you realize that you're comparing the full vs long format there? However, it is true that the _full_ format for the en locale in 1.7.1 is now EEEE, MMMM d, y But really, I think you're confused about what "y" means. It just means "show the year with no zero-padding": autarch@houseabsolute:~/projects/DateTime/data/cldr-svn/common/main$ perl -MDateTime -le 'print DateTime->now->format_cldr("y")' 2009 So it only puts out a two-digit year if the year is actually just two digits. I'm going to close this ticket. -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/
Show quoted text
> Do you realize that you're comparing the full vs long format there?
whoops, long day, sorry. Copy paste between tabs Still: 0.43 my $date_format_full = "EEEE\,\ MMMM\ d\,\ y"; my $date_format_long = "MMMM\ d\,\ y"; 0.42 my $date_format_full = "EEEE\,\ MMMM\ d\,\ yyyy"; my $date_format_long = "MMMM\ d\,\ yyyy"; Show quoted text
> However, it is true that the _full_ format for the en locale in 1.7.1 > is > now EEEE, MMMM d, y > > But really, I think you're confused about what "y" means. It just > means > "show the year with no zero-padding": > > autarch@houseabsolute:~/projects/DateTime/data/cldr-
svn/common/main$ Show quoted text
> perl -MDateTime -le 'print DateTime->now->format_cldr("y")' > 2009 > > So it only puts out a two-digit year if the year is actually just two > digits.
makes sense thanks, however I think I've given a red herring w/ the CLDR format as the change I noticed was with strftime() formats not CLDR multivac:~ dmuey$ perl -MDateTime::Locale -le 'print DateTime::Locale->load("en")->long_date_format();print DateTime::Locale->VERSION;' %B %{day}, %y 0.44 multivac:~ dmuey$ multivac:~ dmuey$ perl -MDateTime::Locale -le 'print DateTime::Locale->load("en")->long_date_format();print DateTime::Locale->VERSION;' %B %{day}, %{ce_year} 0.42 multivac:~ dmuey$ I was thinking maybe the CLDR was used to map to the equivalent strftime() format (I haven't yet found where the strftime in Cpanel::Locale comes, just started digging) and that perhaps the recent CLDR changes weren't remapped correctly or something to that effect. Sorry to bother you with this but I'm not as familiar with it as you are and it seems like a pretty major change in behavior that I can't yet determine where the strftime format change happened. Thanks for your time
yep: DateTime/Locale/Base.pm qr/yyyy/ => '{ce_year}', qr/y/ => 'y', that's a bummer :) At least I understand it now. Do you think that since CLDR has changed should that @JavaPatterns map be updated? Something just seems off with 1999 suddenly becoming 99, just not sure what, if anything, should change :)
Summary of the root issue after some investigation: 1) CLDR is mapped to strftime() in @JavaPatterns: DateTime/Locale/Base.pm qr/yyyy/ => '{ce_year}', qr/y/ => 'y', 2) cldr 1.7.1 (DateTime::Locale 0.43) changed many 'yyyy' to 'y' 3) That unwitting changed the value of many strftime formats to use %y instead of %Y (i.e. 09 instead of 2009): $ perl -MDateTime -le 'print DateTime->now->format_cldr("y & yyyy")' 2009 & 2009 $ perl -MDateTime -le 'print DateTime->now->strftime("%y & %Y")' 09 & 2009 $ 4) The end result is that CLDR formats remain in tact but their strftime() mapping would seem to be incorrect HTH
Subject: Re: [rt.cpan.org #49724] format oddity 4 digit year changed to 2 digit year (w/ cldr 1.7.1 ?)
Date: Tue, 15 Sep 2009 20:32:15 -0500 (CDT)
To: Daniel Muey via RT <bug-DateTime-Locale [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Tue, 15 Sep 2009, Daniel Muey via RT wrote: Show quoted text
> multivac:~ dmuey$ perl -MDateTime::Locale -le 'print > DateTime::Locale->load("en")->long_date_format();print > DateTime::Locale->VERSION;' > %B %{day}, %y
The methods which return strftime patterns are deprecated. Use the ones that return CLDR patterns instead. There is a deprecation notice in the 0.44 release. -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/
Show quoted text
> The methods which return strftime patterns are deprecated. Use the ones > that return CLDR patterns instead. There is a deprecation notice in the > 0.44 release.
Sounds reasonable, thanks.