[ic] Tag Time Adjust - strange behaviour

Bruno Cantieni interchange-users@icdevgroup.org
Fri Jun 14 12:18:00 2002


----- Original Message -----
From: "Mike Heins" <mike@perusion.com>
To: <interchange-users@icdevgroup.org>
Sent: June 14, 2002 9:36 AM
Subject: Re: [ic] Tag Time Adjust - strange behaviour


> Quoting Mike Heins (mike@valuemedia.com):
> > Quoting Bruno Cantieni (bruno@digi-land.com):
> [snip]
> > > Now try it with values such as 100, 200, 300 ... 600 for [scratch TimeTmp].
> > >
> > > I keep getting Friday, June 14, 2002 (unadjusted current date) for
> > > values like that!!!!
> > >
> > > Since my [scratch TimeTmp] is generated in a perl block algorithm I have to do
> > >
> > > $Scratch->{TimeTmp} += 1;
> > >
> > > to get past this "buggy" behaviour.
> > >
> > > Anyone else noticed this or can shed some light on the matter??
> > >
> >
> > I believe the last two trailing zeros are removed if present to allow
> > input of a time zone like +0500 or -0400. If that is not documented,
> > that is a documentation bug; the behavior is not a bug but a feature. 8-)
> >
> >     [loop 2400 4800 9600 20000 30000]
> >
> >     [loop-code] -- [seti TimeFinal][time adjust="[loop-code]"]%A, %B %d, %Y[/time][/seti]
> >     [scratch TimeFinal]<br>
> >
> >     [/loop]
> >
> > -2400 -- Thursday, June 13, 2002
>
> Thanks for finding this. Behavior is less than optimal and logical, I think.
> I have updated the development branch to reflect this documentation:
>
> Accepts the following options:
>
> 4.77.2.1. adjust
> ----------------
>
> If you wish to temporarily adjust the time for display purposes, you
> can pass an adjust parameter with the number of hours (plus or minus).
>
>         [time]%c[/time]
>         [time adjust="-3"]%c[/time]
>
> Will display:
>
>  Mon 01 Jan 2001 11:29:03 AM EST
>  Mon 01 Jan 2001 08:29:03 AM EST
>
> If the number ends in zero and has 3 digits or more, it is assumed
> that the number is in timezone format (i.e +500) the local time or
> from GMT:
>
>         [time]%c[/time]
>         [time adjust="-330"]%c[/time]
>         [time adjust="-300"]%c[/time]
>
> Will display:
>
>  Mon 01 Jan 2001 11:29:03 AM EST
>  Mon 01 Jan 2001 07:59:03 AM EST
>  Mon 01 Jan 2001 08:29:03 AM EST
>
> If you want to force the number to be just a number of hours, add the
> hours parameter:
>
>         [time]%c[/time]
>         [time adjust="100" hours=1]%c[/time]
>
> Will display:
>
>  Mon 01 Jan 2001 11:29:03 AM EST
>  Fri 05 Jan 2001 15:29:03 PM EST
>
> If adjust is an Interchange time duration with a suffix of sec, min,
> hrs, days, or weeks, that will be used.
>
>         [time]%c[/time]
>         [time adjust="2 days"]%c[/time]
>
> Will display:
>
>  Mon 01 Jan 2001 11:29:03 AM EST
>  Wed 03 Jan 2001 11:29:03 AM EST
>
>
> --
> Mike Heins

Thank you for your input as well Mike.

It' working fine now.
We use this to give the customer a delivery date prediction based on product preparation time for
normal or rush service (if applicable), the time it takes for the selected shipping option (based on
the merchants experience for any given method), and takes into account weekends and constitutional
holidays.

You can check it out on any of the stores that are part of the RedGaloshes merchant network
(www.redgaloshes.com)  is based on a radically customised implementation of IC 4.6.5.


Bruno

###########################################
Bruno Cantieni
Digital Landscape - Cyboretum.com
Web Applications * Web Hosting * e-Commerce
http://www.digi-land.com
http://www.cyboretum.com
bruno@digi-land.com
Phone/Fax: 905.668.2255