[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [1214] trunk
- Subject: SF.net SVN: ledger-smb: [1214] trunk
- From: ..hidden..
- Date: Fri, 18 May 2007 19:30:27 -0700
Revision: 1214
http://svn.sourceforge.net/ledger-smb/?rev=1214&view=rev
Author: tetragon
Date: 2007-05-18 19:30:27 -0700 (Fri, 18 May 2007)
Log Message:
-----------
Fix for longformat of '' and tests
Modified Paths:
--------------
trunk/LedgerSMB/Locale.pm
trunk/t/03-date-handling.t
Modified: trunk/LedgerSMB/Locale.pm
===================================================================
--- trunk/LedgerSMB/Locale.pm 2007-05-19 02:30:01 UTC (rev 1213)
+++ trunk/LedgerSMB/Locale.pm 2007-05-19 02:30:27 UTC (rev 1214)
@@ -90,8 +90,8 @@
sub date {
my ( $self, $myconfig, $date, $longformat ) = @_;
-## my @longmonth = (qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec));
- my @longmonth = (
+ my @longmonth = (qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec));
+ @longmonth = (
"January", "February", "March", "April",
"May ", "June", "July", "August",
"September", "October", "November", "December"
Modified: trunk/t/03-date-handling.t
===================================================================
--- trunk/t/03-date-handling.t 2007-05-19 02:30:01 UTC (rev 1213)
+++ trunk/t/03-date-handling.t 2007-05-19 02:30:27 UTC (rev 1214)
@@ -35,6 +35,9 @@
my @months = ('January', 'February', 'March', 'April', 'May ', 'June',
'July', 'August', 'September', 'October', 'November', 'December');
+my @mon = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+ 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
+
my %month_num = ('01' => '31', '02' => '28', '03' => '31', '04' => '30',
'05' => '31', '06' => '30', '07' => '31', '08' => '31',
'09' => '30', '10' => '31', '11' => '30', '12' => '31');
@@ -73,6 +76,7 @@
my $start = $fmt;
my $temp = sprintf('%02d', $mm);
my $month_en = $locale_en->text($months[$mm - 1]);
+ my $month_en_2 = $locale_en->text($mon[$mm - 1]);
my $month_es = $locale_es->text($months[$mm - 1]);
$start =~ s/dd/29/;
$start =~ s/yyyy/2000/;
@@ -82,7 +86,12 @@
"$month_es 29 2000", "date, $start, $fmt: long, es");
cmp_ok($locale_en->date(\%myconfig, $start, 1), 'eq',
"$month_en 29 2000", "date, $start, $fmt: long, en");
+ cmp_ok($locale_en->date(\%myconfig, $start, ''), 'eq',
+ "$month_en_2 29 2000", "date, $start, $fmt: '', en") if
+ $start !~ /^\d{4}\D/; # Ack... special case
}
+ cmp_ok($locale_en->date(\%myconfig, '2007-05-18', ''), 'eq',
+ "2007-05-18", "date, 2007-05-18, $fmt: '', en");
}
# $form->current_date checks
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.