[ic] Tag Time Adjust - strange behaviour

Mike Heins interchange-users@icdevgroup.org
Fri Jun 14 08:51:01 2002


Quoting Bruno Cantieni (bruno@digi-land.com):
> Today is Friday, June 14, 2002
> 
> For [scratch TimeTmp] = 24
> 
> [seti TimeFinal][time adjust="[scratch TimeTmp]"]%A, %B %d, %Y[/time][/seti]
> 
> will properly produce Saturday, June 15, 2002
> 
> For [scratch TimeTmp] = 48
> 
> [seti TimeFinal][time adjust="[scratch TimeTmp]"]%A, %B %d, %Y[/time][/seti]
> 
> will properly produce Sunday, June 16, 2002
> 
> etc. etc...
> 
> 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
2400 -- Saturday, June 15, 2002
4800 -- Sunday, June 16, 2002
9600 -- Tuesday, June 18, 2002
20000 -- Saturday, June 22, 2002
30000 -- Wednesday, June 26, 2002

Yup. It would be easy to add an "adjust-integer" parameter to the
tag to behave as you want. Or you can just give it a number like
300.0 or even 300. , I think:

-24.0 -- Thursday, June 13, 2002
24.0 -- Saturday, June 15, 2002
48.0 -- Sunday, June 16, 2002
96.0 -- Tuesday, June 18, 2002
200.0 -- Saturday, June 22, 2002
300.0 -- Wednesday, June 26, 2002
300. -- Wednesday, June 26, 2002

Yes, that is true too.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting
phone +1.513.523.7621      <mike@perusion.com>

How far can you open your mind before your brains fall out?