Timely topic, thanks for the tip. Now, let's go one step further. It would be great to have a $TODAY_DAY variable and a <% TODAY MONTH LINK %> tag. Also, some zero-based day/month vars that would work with the *_NAMES and *_ABBREVIATIONS vars would be a nice touch, too.
[ Afterthought: Even better would be a way to enter date(1) format directives when displaying a date. Something like the following would display "30-Mar-2007".
<%= $DATE_FMT->( "%d-%b-%Y", $TODAY_EPOCH ) %>
Take a look at the Date::Format class in the Date-Time distribution on CPAN: http://search.cpan.org/~gbarr/TimeDate-1.16/ ]
In my custom calendar, I am displaying a month view only. At the bottom is a field that works as follows.
. if the displayed month is the current month it says "Today is 30-Mar-2007", or whatever, and the text is not a link
. if the displayed month is any other month it says "Go to Current Month", and the text is a link to the current month
The following works, but it's rather cumbersome.
Thanks,
--
<%if ($MONTH eq $TODAY_MONTH) {%>
Today is <%= substr( $TODAY_DATESTRING, -2, 2 ) %>-<%= $MONTH_ABBREVIATIONS->[ $TODAY_MONTH - 1 ] %>-<%= $TODAY_YEAR %>
<%} else {%>
<a href="/cgi-bin/calendar/calendar.pl?month=<%= $TODAY_MONTH %>&calendar=<%= $CALENDAR_KEY %>&year=<%= $TODAY_YEAR %>"> Go to Current Month </a>
<%}%>
------------------
[This message has been edited by ccobb (edited March 30, 2007).]