[ic] Modification of a passed Date Value

Kevin Walsh kevin at cursor.biz
Tue Mar 2 14:09:36 EST 2004


Mike Heins [mike at perusion.com] wrote:
> > It seems that tag wasn't written to apply the "days" offset to a
> > supplied date value - only to the current date (when no overriding
> > date value has been supplied).
> > 
> > The following patch seems to work, so I will apply it to the 5.1.x
> > development CVS unless anyone has an objection, or can suggest a better
> > way to do it:
> >
> > [snip: convert_date.tag patch] 
> >
> I think this might be better:
> 
> 	if($days) {
> 		$days .= ' days' if $days =~ /^[-\s\d]+$/;
> 		$now += Vend::Config::time_to_seconds($days);
> 	}
> 
> At that point, $days might be better called $adj.
>
That would be good, but may be confusing if someone needs to call
the sub as [convert-date days="-2 hours"], so it would be good to
also have "adjust" as an alias and depreciate "days":

    UserTag convert_date attrAlias adjust days

Or the other way around, which would make the depreciation clearer:

    UserTag convert_date Order adjust
    UserTag convert_date attrAlias days adjust

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/



More information about the interchange-users mailing list