[interchange-cvs] interchange - racke modified lib/Vend/Interpolate.pm
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Thu Mar 20 06:25:02 2003
User: racke
Date: 2003-03-20 11:24:17 GMT
Modified: lib/Vend Interpolate.pm
Log:
date_change filter is now able to handle dates in MySQL date style
too, so the administration works fine with MySQL DATE(TIME) fields
Revision Changes Path
2.152 +10 -3 interchange/lib/Vend/Interpolate.pm
rev 2.152, prev_rev 2.151
Index: Interpolate.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.151
retrieving revision 2.152
diff -u -r2.151 -r2.152
--- Interpolate.pm 7 Mar 2003 19:48:05 -0000 2.151
+++ Interpolate.pm 20 Mar 2003 11:24:17 -0000 2.152
@@ -1,6 +1,6 @@
# Vend::Interpolate - Interpret Interchange tags
#
-# $Id: Interpolate.pm,v 2.151 2003/03/07 19:48:05 mheins Exp $
+# $Id: Interpolate.pm,v 2.152 2003/03/20 11:24:17 racke Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -27,7 +27,7 @@
require Exporter;
@ISA = qw(Exporter);
-$VERSION = substr(q$Revision: 2.151 $, 10);
+$VERSION = substr(q$Revision: 2.152 $, 10);
@EXPORT = qw (
@@ -873,8 +873,15 @@
$val =~ s/\0+//g;
return $val
unless $val =~ m:(\d+)[-/]+(\d+)[-/]+(\d+):;
- my ($yr, $mon, $day) = ($3, $1, $2);
+ my ($yr, $mon, $day);
+ if (length($1) == 4) {
+ # MySQL date style 2003-03-20
+ ($yr, $mon, $day) = ($1, $2, $3);
+ } else {
+ ($yr, $mon, $day) = ($3, $1, $2);
+ }
+
my $time;
$val =~ /:(\d+)$/
and $time = $1;