[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1213] branches/1.2



Revision: 1213
          http://svn.sourceforge.net/ledger-smb/?rev=1213&view=rev
Author:   tetragon
Date:     2007-05-18 19:30:01 -0700 (Fri, 18 May 2007)

Log Message:
-----------
Fix for longformat of '' and tests

Modified Paths:
--------------
    branches/1.2/LedgerSMB/Locale.pm
    branches/1.2/t/03-date-handling.t

Modified: branches/1.2/LedgerSMB/Locale.pm
===================================================================
--- branches/1.2/LedgerSMB/Locale.pm	2007-05-18 23:32:13 UTC (rev 1212)
+++ branches/1.2/LedgerSMB/Locale.pm	2007-05-19 02:30:01 UTC (rev 1213)
@@ -84,8 +84,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: branches/1.2/t/03-date-handling.t
===================================================================
--- branches/1.2/t/03-date-handling.t	2007-05-18 23:32:13 UTC (rev 1212)
+++ branches/1.2/t/03-date-handling.t	2007-05-19 02:30:01 UTC (rev 1213)
@@ -30,6 +30,8 @@
 
 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',
@@ -69,6 +71,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/;
@@ -78,7 +81,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.