Template::Plugin::Calendar::Simple(3pm)

Template::Plugin::Calendar::Simple3pm

Just another html calendar generator.

Usage

  [% 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>

Overview

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.

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.

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.

Github

The Github project is <https://github.com/jeffa/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>

Releases

10 releases since Debian 3.1 (Sarge); the text changed 5 times.

  1. 3.1
  2. 4.0–7
  3. 8
  4. 9–10
  5. 12
  6. 13

Author

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

From libtemplate-plugin-calendar-simple-perl 1.04-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.