[ic] Modification of a passed Date Value
Kevin Walsh
kevin at cursor.biz
Thu Mar 4 14:20:27 EST 2004
Aaron Hazelton [aaronmail at hazenet.net] wrote:
>
> this for example works fine:
> [convert-date][scratch value][/convert-date]
>
> however, I am having trouble doing something like this:
> [convert-date adjust="6 days"][scratch value][/convert-date]
>
> by getting this error:
> [04/March/2004:09:32:24 -0500] ccs /i/calendar.html Runtime error:
> Undefined subroutine &Vend::Interpolate::mktime called at (tag 'scratch')
> line 34. >
>
> any ideas? should this not work?
>
It works for me:
[set value]2004-02-18[/set]
[convert-date][scratch value][/convert-date]<br>
[convert-date adjust="6 days"][scratch value][/convert-date]<br>
Gives me:
18-Feb-2004
24-Feb-2004
It could be just my setup that's making it work, so try the following
patch:
======================================================================
*** convert_date.tag 2 Mar 2004 22:35:26 -0000 1.3
--- convert_date.tag 4 Mar 2004 19:18:56 -0000
***************
*** 39,45 ****
}
if ($adjust) {
! $now ||= mktime(@t);
$adjust .= ' days' if $adjust =~ /^[-\s\d]+$/;
if ($adjust =~ s/^\s*-\s*//) {
--- 39,45 ----
}
if ($adjust) {
! $now ||= POSIX::mktime(@t);
$adjust .= ' days' if $adjust =~ /^[-\s\d]+$/;
if ($adjust =~ s/^\s*-\s*//) {
======================================================================
if that fixes it for you then I'll commit to CVS.
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin at cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/
More information about the interchange-users
mailing list