Template::Plugin::ByDate - Keeps/removes included text based on whether the current date is within range.


Template-Plugin-ByDate documentation  | view source Contained in the Template-Plugin-ByDate distribution.

Index


NAME

Top

Template::Plugin::ByDate - Keeps/removes included text based on whether the current date is within range.

VERSION

Top

Version 0.01

SYNOPSIS

Top

    [% USE ByDate %]

    [% FILTER ByDate
         starting = '2006-05-02'
         until = '2006-08-22' %]
    This text only shows up from May 2, 2006 through August 22, 2006.
    [% END %]

FUNCTIONS

Top

init

filter

We accept one optional argument, the word "not". If specified, it will reverse the meaning of the filter: rather than keeping the text if the current date is between starting and until, ignore it. e.g.,

    [% FILTER ByDate
        starting = '2006-05-02'
        until = '2006-08-22' %]
    This only shows up inside the date range
    [% END %]

while

    [% FILTER ByDate
        'not' starting = '2006-05-02'
        until = '2006-08-22' %]
    This only shows up outside the date range
    [% END %]

The starting and until dates are actually parsed by Date::Parse. If you do not specify a time, the starting time is 00:00:00, while the until time is 23:59:59. This is done by checking the until stamp for a colon - if there is no colon, we add " 23:59:59" to the string before passing it into Date::Parse. If that doesn't work for you, please let me know what string you're using.

AUTHOR

Top

Darin McBride, <dmcbride at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-template-plugin-bydate at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Template-Plugin-ByDate. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Template::Plugin::ByDate

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Template-Plugin-ByDate

* CPAN Ratings

http://cpanratings.perl.org/d/Template-Plugin-ByDate

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Template-Plugin-ByDate

* Search CPAN

http://search.cpan.org/dist/Template-Plugin-ByDate

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


Template-Plugin-ByDate documentation  | view source Contained in the Template-Plugin-ByDate distribution.