Calendar::Model - Simple class modelling Calendars
Version 0.04
use Calendar::Model; my $cal = Calendar::Model->new(); my $columns = $cal->columns; my $rows = $cal->rows; my $dates = $cal->as_list; my $start_date = $cal->start_date; my $selected_date = $cal->selected_date my $month = $cal->month; # 3 my $year = $cal->year; # 1992 my $next_month = $cal->next_month; # 4 my $prev_month = $cal->previous_month; # 2 my $month_name = $cal->month_name; # March my $next_month_name = $cal->month_name('next'); # April my $day = $cal->get_day($dt); my $events = $schema->resultset('events')->search( date => { between => [$cal->start_date->dmy,$cal->last_entry_day->dmy] });
A simple Model layer providing Classes representing A Calendar containing rows and days
Class constructor method, returns a Calendar::Model object based on the arguments :
Std Moose initialisation hook called by constructor method
Object method (lazily) builds and returns rows of Calendar::Model::Day objects, 1 for each week.
Object method returns all Calendar::Model::Day objects for calendar
Object method, returns name of current/selected month or takes a string indicating whether to show 'next' or 'previous' month.
my $month_name = $cal->month_name; # March my $next_month_name = $cal->month_name('next'); # April
Get last day in calendar as a DateTime object
Get given day from Calendar, takes a DateTime object, returns a Calendar::Modal::Day object
Aaron Trevena, <teejay at cpan.org>
<teejay at cpan.org>
Please report any bugs or feature requests to bug-calendar-model at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Calendar-Model. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-calendar-model at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Calendar::Model
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Calendar-Model
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Calendar-Model
CPAN Ratings
http://cpanratings.perl.org/d/Calendar-Model
Search CPAN
http://search.cpan.org/dist/Calendar-Model/
Copyright 2012 Aaron Trevena.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Calendar::Model, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Calendar::Model
CPAN shell
perl -MCPAN -e shell install Calendar::Model
For more information on module installation, please visit the detailed CPAN module installation guide.