summaryrefslogtreecommitdiff
path: root/LedgerSMB/Locale.pm
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-06-15 16:09:28 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-06-15 16:09:28 +0000
commit138412133fb53b5419640311bbd5f253d7407373 (patch)
treece236c1539c8b611e828c20c6743bee640f4d598 /LedgerSMB/Locale.pm
parent37342ac1139a50eb465c44cfb529cfa53c991e7f (diff)
Minor refactoring to &date
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1280 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/Locale.pm')
-rw-r--r--LedgerSMB/Locale.pm24
1 files changed, 5 insertions, 19 deletions
diff --git a/LedgerSMB/Locale.pm b/LedgerSMB/Locale.pm
index 80b3446f..0a38961e 100644
--- a/LedgerSMB/Locale.pm
+++ b/LedgerSMB/Locale.pm
@@ -16,7 +16,7 @@ Locale support module for LedgerSMB. Uses Locale::Maketext::Lexicon as a base.
Returns a locale handle for accessing the other methods. Inherited from
Locale::Maketext.
-=item text ($string)
+=item text ($string, @params)
Returns the translation for the given string. This is a legacy wrapper that
merely calls $self->maketext.
@@ -136,41 +136,27 @@ sub date {
}
else {
-
$date = substr( $date, 2 );
( $yy, $mm, $dd ) = ( $date =~ /(..)(..)(..)/ );
}
$dd *= 1;
- $mm--;
$yy += 2000 if length $yy == 2;
+ $dd = substr( "0$dd", -2 );
+ $mm = substr( "0$mm", -2 );
if ( $myconfig->{dateformat} =~ /^dd/ ) {
-
- $mm++;
- $dd = substr( "0$dd", -2 );
- $mm = substr( "0$mm", -2 );
$longdate = "$dd$spc$mm$spc$yy";
-
}
elsif ( $myconfig->{dateformat} =~ /^yy/ ) {
-
- $mm++;
- $dd = substr( "0$dd", -2 );
- $mm = substr( "0$mm", -2 );
$longdate = "$yy$spc$mm$spc$dd";
-
}
else {
-
- $mm++;
- $dd = substr( "0$dd", -2 );
- $mm = substr( "0$mm", -2 );
$longdate = "$mm$spc$dd$spc$yy";
-
}
+
if ( defined $longformat ) {
- $longdate = &text( $self, $longmonth[ --$mm ] ) . " $dd $yy";
+ $longdate = $self->text( $longmonth[ --$mm ] ) . " $dd $yy";
}
$longdate;
}