Hello all!
I have a silly noob question. :)
I am storing numbers in an array, and I want to be able to create a string
including one of those array indexes "minus 1", or "plus 1", etc...
Example: (incomplete..but this has stopped me!!)
[%- dateArray = date.match('(\d{4})(\d{2})(\d{2})');
#SET ds = { 1 = 'SUN', 2 = 'MON', 3 = 'TUE', 4 = 'WED', 5 = 'THU', 6 =
'FRI', 7 = 'SAT' };
weekNum = cal.calendar_week(dateArray.2);
weekDys = cal.week_definition(weekNum);
IF weekNum > 1;
newDate = "${dateArray.0}${dateArray.1}${weekDys.0 -1}";
SET prvWeekLnk = 'browsevents.cgi?date=$newDate&view=week';
ELSE;
IF weekDys.0 == 1;
END;
END;
-%]
In the line: newDate = "${dateArray.0}${dateArray.1}${weekDys.0 -1}";
I have tried.
newDate = "${dateArray.0}${dateArray.1}"+"(${weekDys.0} -1)";
newDate = "${dateArray.0}${dateArray.1}${${weekDys.0} -1}";
newDate = "${dateArray.0}${dateArray.1}(${weekDys.0} -1)";
AND!!
newDate = "${dateArray.0}${dateArray.1}$weekDys.0 -1";
To no avail!!
I either get: unexpected token (-1)
Or the date with -1 added to the end, or even sometimes with the last part
missing.
I know I am putting too much in the template, I should probably move all
this into the script, but it would be REAL nice if I could make it work
this way, for other reasons.
Any ideas?
--
Kelly Thompson
Vice President
Live Audio Magazine Inc.
www.liveaudiomag.com
(919) 389-5784
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates