in reply to Date-sensitive output with Template Toolkit

You could make your own filter. For 100% accurate details on how to set this up take a look at the TT docs. But something like this should be close (there is extra stuff you need to do to package this routine i.e. putting it in a package, telling TT how to find the package etc. I don't have a ton of time right now so I'll leave you to dig.
sub ByDate { my ($self, $text, $args, $conf) = @_; # Do appropriate time formatting $cooked_now = TimeFormat(time); if($cooked_now > $args->[0] && $cooked_now < $args->[1]) { return $text; } else { return ""; } }
The TT code would look something like this
[% USE MyFilter %] [% FILTER $MyFilter <start> <end> %] Don't display this before <start> or after <end> [% END %]
As I said, I forget exactly how the linkage between MyFilter and your code works, I do remember it's explained very well in the docs. Hope this helps.

Replies are listed 'Best First'.
Re^2: Date-sensitive output with Template Toolkit
by Clachair (Acolyte) on Apr 06, 2006 at 00:06 UTC
    Hm. This looks like a problem I had with a family schedule that had to accomodate changing work shifts and several grandchildrens' school dates.
    My amateurish result can be seen at
    http:www.oceandreams.net/fam_sched/
    using a text file as a database.
    I'll e-mail the code if it's at all usefull to you; I can't do it from work, otherwise I'd attach it here.

    Regards,
    Clachair
    Never lick a gift horse in the mouth.