logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Template::Plugin::Calendar::Simple - Just another HTML calendar generator.

Author

       Jeff Anderson, "<jeffa at cpan.org>"

Bugs And Limitations

       Please report any bugs or feature requests to either

       •   Email: "bug-template-plugin-calendar-simple at rt.cpan.org"

       •   Web: <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Template-Plugin-Calendar-Simple>

       I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

Description

       Provides calendar delimiters for a Template Toolkit template via Calendar::Simple. This module supplies
       the data, you supply the HTML.  Defaults to current month within the current year. Past months and years
       can be specified within the Template constructor:

         [% USE cal = Calendar.Simple( 5, 2000 ) %]

       Can generate calendars that start with Monday instead of Sunday like so:

         [% USE cal = Calendar.Simple( 5, 2000, 1 ) %]
         ...
           [% FOREACH day = cal.days( 1 ) %]
           ...

       See the unit tests for more examples.

Github

       The Github project is <https://github.com/jeffa/Template-Plugin-Calendar-Simple>

Methods

       new()
           Constructor. Will be called for you by the Template Toolkit engine.

       rows()
              [% FOREACH row = cal.rows %]

           Returns  a  Template::Iterator  which  contains  the  calendar rows.  Each row, however, is simply an
           array.

       days()
              [% FOREACH day = cal.days %]

           Most calendars have a header with the days - this method returns an array of  abbreviated  day  names
           (currently  only in English). If any argument is passed, then the week day starts with Monday instead
           of Sunday.

Name

       Template::Plugin::Calendar::Simple - Just another HTML calendar generator.

See Also

       •   Template::Plugin

       •   Calendar::Simple.

Support

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

           perldoc Template::Plugin::Calendar::Simple

       You can also look for information at:

       •   RT:          CPAN's          request          tracker          (report           bugs           here)
           <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Template-Plugin-Calendar-Simple>

       •   AnnoCPAN: Annotated CPAN documentation <http://annocpan.org/dist/Template-Plugin-Calendar-Simple>

       •   CPAN Ratings <http://cpanratings.perl.org/d/Template-Plugin-Calendar-Simple>

       •   Search CPAN <http://search.cpan.org/dist/Template-Plugin-Calendar-Simple>

Synopsis

         [% USE cal = Calendar.Simple %]

         <table border="1">
           <tr>
           [% FOREACH day = cal.days %]
             <th>[% day %]</th>
           [% END %]
           </tr>
           [% FOREACH row = cal.rows %]
           <tr>
           [% FOREACH col = row %]
             <td>[% col || '&nbsp;' %]</td>
           [% END %]
           </tr>
         [% END %]
         </table>

See Also