[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [1280] trunk/LedgerSMB/Locale.pm
- Subject: SF.net SVN: ledger-smb: [1280] trunk/LedgerSMB/Locale.pm
- From: ..hidden..
- Date: Fri, 15 Jun 2007 09:09:29 -0700
Revision: 1280
http://svn.sourceforge.net/ledger-smb/?rev=1280&view=rev
Author: tetragon
Date: 2007-06-15 09:09:28 -0700 (Fri, 15 Jun 2007)
Log Message:
-----------
Minor refactoring to &date
Modified Paths:
--------------
trunk/LedgerSMB/Locale.pm
Modified: trunk/LedgerSMB/Locale.pm
===================================================================
--- trunk/LedgerSMB/Locale.pm 2007-06-15 16:02:16 UTC (rev 1279)
+++ trunk/LedgerSMB/Locale.pm 2007-06-15 16:09:28 UTC (rev 1280)
@@ -16,7 +16,7 @@
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 @@
}
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;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.