Subject: | Bug: Date-Calc-6.3 errors in parsing calendar profiles |
Date: | Mon, 3 May 2010 15:39:13 +0200 |
To: | bug-Date-Calc [...] rt.cpan.org |
From: | Horst Prote <prote [...] fmi.uni-stuttgart.de> |
Hello!
I'm a Gentoo User and after upgrading from dev-perl/Date-Calc-5.4 to
dev-perl/Date-Calc-6.3 I got this error from a perl script using an
german calendar profile:
Date::Calendar::Year::new(): date '#2/Sun/May' for day 'Muttertag' is invalid
Steps to Reproduce:
1. Upgrade to dev-perl/Date-Calc-6.3
2. Run this little perl script:
use Date::Calc qw(Decode_Language);
use Date::Calendar::Profiles qw($Profiles);
use Date::Calendar;
$cal = Date::Calendar::Year->new( 2010, $Profiles->{'DE-BW'},
Decode_Language("deutsch") );
Actual Results:
Date::Calendar::Year::new(): date '#2/Sun/May' for day 'Muttertag' is invalid
at - line 4
Expected Results:
No error here
This is caused by adding the "$lang" parameter to
&_invalid_($item,$name) unless ($dow = Decode_Day_of_Week($dow,$lang));
in line 244 of /usr/lib/perl5/vendor_perl/5.8.8/Date/Calendar/Year.pm but still
using english tokens like "Sun" (in german this would be "Son") in the calendar
profiles (/usr/lib/perl5/vendor_perl/5.8.8/Date/Calendar/Profiles.pm). So this
may affect other languages too.
Possible fixes are:
- remove the optional "$lang" parameter (as it was in dev-perl/Date-Calc-5.4)
- change the english tokens in all affected non-english calendar profiles to
their language specific names
Horst