Class::DBI::Plugin::Calendar::Day - Calendar Day Support for Class::DBI
package DB; use base 'Class::DBI'; use Class::DBI::Plugin::Calendar qw(date_fieldname); my @weeks = DB->calendar; # current month, based on Calendar::Simple for my $week (@weeks) { for my $day (@$week) { # always 7 days, some may be placeholders if($day->ok) { printf '%03d', $day->date->mday; } else { # just a placeholder print " "; } print "\n"; } } @events = $day->events unless $day->empty;
These are simple objects which represent days in Class::DBI::Plugin::Calendar applications.
This means that this day refers to a real day, and is not just a placeholder so that the week in which it resides may contain seven days. This should be called before $day->date for each object. Otherwise, you're in danger of croak()ing. Aliases are: is, good, is_good, is_ok.
This returns a Time::Piece object representing the date. You must call $day->ok before this method, since the application will croak() if this day does not represent a valid date. (It may be a simple placeholder so that weeks always have seven days, in order.
This gives the number of events in the day. Aliases: num, sum, has.
The opposite of num_events.
The events for that day, ordered by date_fieldname (above). Aliases: objects, events
Class::DBI, Calendar::Simple, Class::DBI::Plugin::Calendar
James Tolley, <james@bitperfect.com>
Copyright (C) 2005 by James Tolley
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
To install Class::DBI::Plugin::Calendar, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::DBI::Plugin::Calendar
CPAN shell
perl -MCPAN -e shell install Class::DBI::Plugin::Calendar
For more information on module installation, please visit the detailed CPAN module installation guide.