Subject: | Rose::DateTime and DateTime::Locale 0.3x |
Date: | Mon, 24 Jan 2011 17:50:45 +0100 |
To: | bug-Rose-DateTime [...] rt.cpan.org |
From: | Sven Schöling <s.schoeling [...] linet-services.de> |
R:DT does not specify which DateTime::Locale version it needs. DT:L
changed its API in v0.4. Methods now ending with '_short', '_long',
'medium', and '_full' used to be prefixed with those expressions. R:DT:U
uses those in init_europea_dates, which dies on old DT:L versions.
Attached is a patch against Rose/DB/Util.pm 0.534 that seems to work,
although I didn't put much effort into correct version handling.
Data:
Rose-DateTime-Util-0.534, as installed by Ubuntu package
librose-db-util-perl, but identical with the cpan version for this case.
Test machine #1, Ubuntu 9.04
$ uname -a
Linux ls-bs-ws15 2.6.31.1 #1 SMP Fri Oct 2 13:05:50 CEST 2009 x86_64
GNU/Linux
$ perl -v
This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi
$ perl -le 'eval "use $_; print qq|$_ => \$${_}::VERSION|" for
qw(Rose::DateTime::Util DateTime::Locale)'
Rose::DateTime::Util => 0.534
DateTime::Locale => 0.45
Test machine #2, Ubuntu 8.04 LTS Server (the reason for all that)
# uname -a
Linux ubuntu804 2.6.24-24-server #1 SMP Tue Jul 7 20:21:17 UTC 2009 i686
GNU/Linux
# perl -v
This is perl, v5.8.8 built for i486-linux-gnu-thread-multi
# perl -le 'eval "use $_; print qq|$_ => \$${_}::VERSION|" for
qw(Rose::DateTime::Util DateTime::Locale)'
Rose::DateTime::Util => 0.534
DateTime::Locale => 0.35
Test machine #3, Debian Etch
# uname -a
Linux debian-etch 2.6.18-6-486 #1 Sat Dec 27 08:57:46 UTC 2008 i686
GNU/Linux
# perl -v
This is perl, v5.8.8 built for i486-linux-gnu-thread-multi
# perl -le 'eval "use $_; print qq|$_ => \$${_}::VERSION|" for
qw(Rose::DateTime::Util DateTime::Locale)'
Rose::DateTime::Util => 0.534
DateTime::Locale => 0.3101
--
Sven Schöling
Entwickler
LINET Services GmbH | Am Alten Bahnhof 4b | 38122 Braunschweig
Tel. 0531-180508-0 | Fax 0531-180508-29 | http://www.linet-services.de
Geschäftsführung: Philip Reetz und Torsten Börner
HR B 9170 Amtsgericht Braunschweig
----------------------------------------------------
Besuchen Sie uns auf der CeBIT (1. bis 5. März) auf
dem Univention-Partnerstand in Halle 2 Stand D36
----------------------------------------------------
--- a/Rose/DateTime/Util.pm 2010-03-22 21:29:25.000000000 +0100
+++ b/Rose/DateTime/Util.pm 2011-01-24 17:26:48.000000000 +0100
@@ -57,8 +57,10 @@
my $locale_class = DateTime::Locale->load(DateTime->DefaultLocale);
- my $short = $locale_class->date_format_short;
-
+ my $short = $DateTime::Locale::VERSION >= 0.4
+ ? $locale_class->date_format_short
+ : $locale_class->short_date_format;
+
$short =~ tr{dmyDMY}{}cd;
$short =~ tr{dmyDMY}{dmydmy}s;