Skip Menu |

This queue is for tickets about the Gedcom-Date CPAN distribution.

Report information
The Basics
Id: 52372
Status: resolved
Worked: 30 min
Priority: 0/
Queue: Gedcom-Date

People
Owner: Nobody in particular
Requestors: robf [...] geekthing.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.04
Fixed in: (no value)



Subject: Y2k-like bug causing test suite to fail
Many tests in t/101_output.t are failing due to what looks like a Y2k issue. In fact, there is a %y in the long_date_format of the "en" locale, and Gedcom::Date strips leading zeros, and the year 2003 shows up as just "3". I'm guessing that the long_date_format used to be different for this locale, and has broken the test suite for this module. For my own use, I've added a small bit of code to DateTime::Gedcom::Simple that fixes the problem, substituting any %y in long_date_format with %Y. This allows the supplied suite to pass. I don't want 2-digit years in my genealogy data anyway. Here's the patch: *** Gedcom-Date-0.04-orig/lib/Gedcom/Date/Simple.pm 2003-08-31 07:13:23.000000000 -0500 --- Gedcom-Date-0.04-robf/lib/Gedcom/Date/Simple.pm 2009-12-02 13:28:50.000000000 -0600 *************** *** 178,184 **** $dt->set(locale => $locale); if ($self->{known}{d}) { ! return $dt->strftime($dt->locale->long_date_format); } elsif ($self->{known}{m}) { return $dt->strftime('%B %Y'); } else { --- 178,186 ---- $dt->set(locale => $locale); if ($self->{known}{d}) { ! my $format = $dt->locale->long_date_format; ! $format =~ s/%y\b/%Y/g; # never, EVER, use 2-digit years ! return $dt->strftime($format); } elsif ($self->{known}{m}) { return $dt->strftime('%B %Y'); } else {
Hi Rob Fixed in V 0.05. Thanx. Ron Savage (new co-maintainer)