[interchange-cvs] interchange - heins modified code/Filter/duration.filter

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Mon Feb 14 02:26:28 EST 2005


User:      heins
Date:      2005-02-14 07:26:28 GMT
Modified:  code/Filter duration.filter
Log:
* Return original value if duration is zero -- allows setting the
  end date directly if desired without removing the filter.

Revision  Changes    Path
1.2       +5 -1      interchange/code/Filter/duration.filter


rev 1.2, prev_rev 1.1
Index: duration.filter
===================================================================
RCS file: /var/cvs/interchange/code/Filter/duration.filter,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- duration.filter	14 Feb 2005 06:59:52 -0000	1.1
+++ duration.filter	14 Feb 2005 07:26:28 -0000	1.2
@@ -1,7 +1,7 @@
 # Copyright 2002-2004 Interchange Development Group (http://www.icdevgroup.org/)
 # Copyright 1996-2002 Red Hat, Inc.
 # Licensed under the GNU GPL v2. See file LICENSE for details.
-# $Id: duration.filter,v 1.1 2005/02/14 06:59:52 mheins Exp $
+# $Id: duration.filter,v 1.2 2005/02/14 07:26:28 mheins Exp $
 
 CodeDef duration Filter
 CodeDef duration Routine <<EOR
@@ -28,6 +28,10 @@
 	while($durstring =~ s/(\d+\s*[hmwd]\w*)\s*//) {
 		$duration += Vend::Config::time_to_seconds($1);
 	}
+
+	## Want to allow setting the value directly
+	return $val unless $duration;
+
 	$start =~ s/\0+//g;
 	if($start =~ m:(\d+)[-/]+(\d+)[-/]+(\d+):) {
 		my ($yr, $mon, $day) = ($3, $1, $2);








More information about the interchange-cvs mailing list