From cb6007f020247f421dc6d8ca819ad38b032a2cdf Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 1 Feb 2010 13:32:55 +0000 Subject: (iso8601_date_to_locale) simplify so that we do not bring in too many required packages --- mdkapplet_gui.pm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mdkapplet_gui.pm b/mdkapplet_gui.pm index cc416977..2a55b88b 100644 --- a/mdkapplet_gui.pm +++ b/mdkapplet_gui.pm @@ -25,7 +25,6 @@ package mdkapplet_gui; use strict; use lib qw(/usr/lib/libDrakX); use common; -use DateTime; our @ISA = qw(Exporter); our @EXPORT = qw( @@ -127,10 +126,6 @@ sub setVar { sub iso8601_date_to_locale { my ($date) = @_; return $date if $date !~ /(\d\d\d\d)-?(\d\d)-?(\d\d)/; - my $dt = DateTime->new(year => $1, month => $2, day => $3); - my $date1 = $dt->strftime("%x"); - # will fail on some locales (eg: br_FR, ...): - eval { $dt->set_locale($ENV{LC_TIME}) }; - my $date2 = $dt->strftime("%x"); - $date2 || $date1; + strftime("%x", 0, 0, 0, $3, $2, $1-1900); } + -- cgit v1.2.1