[interchange-cvs] interchange - racke modified 2 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Mon Feb 2 11:49:52 EST 2004


User:      racke
Date:      2004-02-02 16:49:51 GMT
Modified:  .        WHATSNEW
Modified:  code/UserTag convert_date.tag
Log:
Add locale option to [convert-date] following a suggestion from
Rene Hertell" <rene at hertell.com>.

Revision  Changes    Path
2.189     +3 -0      interchange/WHATSNEW


rev 2.189, prev_rev 2.188
Index: WHATSNEW
===================================================================
RCS file: /anon_cvs/repository/interchange/WHATSNEW,v
retrieving revision 2.188
retrieving revision 2.189
diff -u -r2.188 -r2.189
--- WHATSNEW	2 Feb 2004 09:23:36 -0000	2.188
+++ WHATSNEW	2 Feb 2004 16:49:51 -0000	2.189
@@ -85,6 +85,9 @@
 
 * Add option to specify useragent to get_url tag.
 
+* Add locale option to [convert-date] following a suggestion from 
+  Rene Hertell" <rene at hertell.com>.
+
 UI
 --
 



1.2       +7 -5      interchange/code/UserTag/convert_date.tag


rev 1.2, prev_rev 1.1
Index: convert_date.tag
===================================================================
RCS file: /anon_cvs/repository/interchange/code/UserTag/convert_date.tag,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- convert_date.tag	29 Jan 2002 05:52:42 -0000	1.1
+++ convert_date.tag	2 Feb 2004 16:49:51 -0000	1.2
@@ -52,15 +52,17 @@
 	}
 
 	my ($current, $out);
-	if ($Scratch->{mv_locale}) {
+	my $locale = $opt->{locale} || $Scratch->{mv_locale};
+	if ($locale) {
 		$current = POSIX::setlocale(&POSIX::LC_TIME);
-		POSIX::setlocale(&POSIX::LC_TIME, $Scratch->{mv_locale});
+		POSIX::setlocale(&POSIX::LC_TIME, $locale);
 		$out = POSIX::strftime($fmt, @t);
 		POSIX::setlocale(&POSIX::LC_TIME, $current);
-	} else {	 
-        $out = POSIX::strftime($fmt, @t);
-    }
+	} else {
+		$out = POSIX::strftime($fmt, @t);
+	}
 	$out =~ s/\b0(\d)\b/$1/g if $opt->{zerofix};
 	return $out;
 }
 EOR
+








More information about the interchange-cvs mailing list