HTML-Pen
view release on metacpan or search on metacpan
lib/HTML/Pen/Iterator/Example.pod view on Meta::CPAN
# Below is stub documentation for your module. You'd better edit it!
=head1 NAME
HTML::Pen::Iterator - Creating a calendar using a Pen Iterator
=head1 SYNOPSIS
$festival = [
[
bless( {}, 'empty' ),
bless( {}, 'empty' ),
bless( {}, 'empty' ),
bless( {}, 'empty' ),
[
[
bless( {
'weekday' => 'Thursday',
'localtime' => [
0,
0,
11,
1,
8,
111,
4,
243,
1
],
'time' => '11:00:00',
'month' => 'Sep',
'date' => 1314889200,
'timedisplay' => '11:00 am',
'event' => 'Pamelas Catering Food Tent',
'midnight' => 1314849600,
'monthday' => 1,
'monthno' => 8,
'yearday' => 243,
'monthname' => 'September',
'year' => 2011
}, 'event' )
],
[
bless( {
'weekday' => 'Thursday',
'localtime' => [
0,
0,
14,
1,
8,
111,
4,
243,
1
],
'time' => '14:00:00',
'month' => 'Sep',
'date' => 1314900000,
'timedisplay' => '2:00 pm',
'event' => 'MID AMERICA SHOWS CARNIVAL',
'midnight' => 1314849600,
'monthday' => 1,
'monthno' => 8,
'yearday' => 243,
lib/HTML/Pen/Iterator/Example.pod view on Meta::CPAN
'monthday' => 29,
'monthno' => 8,
'yearday' => 271,
'monthname' => 'September',
'year' => 2011
}, 'dates' ),
bless( {
'weekday' => 'Friday',
'localtime' => [
0,
0,
0,
30,
8,
111,
5,
272,
1
],
'time' => '00:00:00',
'month' => 'Sep',
'date' => 1317355200,
'midnight' => 1317355200,
'monthday' => 30,
'monthno' => 8,
'yearday' => 272,
'monthname' => 'September',
'year' => 2011
}, 'dates' ),
bless( {}, 'empty' )
]
];
=head1 DESCRIPTION
The Data::Dumper output of the data set used in the example in
L<HTML::Pen::Iterator>.
The code is primarily intended to demonstrate the data structure.
\@weeks -> \@days -> \@times -> \@events -> \%event objects
The first two dimensions consist of 35 days elements displayed as a 5x7
HTML table. Each days elements is one of the following:
=over 2
=list
A reference to an array of times. This object recurses to display a
chronological list of events.
=list
A reference to a B<data> object. This object displays its B<monthday>
property and does not recurse.
=list
A reference to an B<empty> object. This object returns no properties
when referenced by C<iteratorValue()>, resulting in empty calendar boxes.
C<iteratorValue()> is type safe, so these objects could be undefined
scalars instead.
=back
When a days element is represented by an array reference containing a
nested set of B<event> objects, each B<event> object contains a duplicate
of the B<date> object to reflect properties normally associated with days
and times objects. As arrays, those objects cannot reflect themselves.
This data duplication is significant. L<HTML::Pen> describes a more
efficient data representation that is probably more appropriate for a
production environment.
=head1 AUTHOR
Jim Schueler, E<lt>jim@tqis.comE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2011 by Jim Schueler
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.9 or,
at your option, any later version of Perl 5 you may have available.
=cut
( run in 0.473 second using v1.01-cache-2.11-cpan-39bf76dae61 )