NAME

Calendar::Any::Util::Calendar - A collection of function for create calendars

VERSION

version 0.5

SYNOPSIS

use Calendar::Any::Util::Calendar qw(calendar);
print calendar(12, 2006), "\n";

DESCRIPTION

A very simple module that output various calendars.

calendar(month, year, [package])

Output the calendar for the month in the year. If given package, output the calendar of the package. For example:

print calendar(12, 2006, 'Julian'), "\n";

This will output calendar in Julian calendar.

generic_calendar(month, year, [package])

Return an array of dates in the month break by weekday:

( [ undef, undef, undef, undef, undef, 1, 2 ],
  [ 3, 4, 5, 6, 7, 8, 9 ],
  [ 10, 11, 12, 13, 14, 15, 16 ],
  [ 17, 18, 19, 20, 21, 22, 23 ],
  [ 24, 25, 26, 27, 28, 29, 30 ],
  [ 31, undef, undef, undef, undef, undef, undef ] )

The default week start day is Sunday. If you want start from Monday, set $week_start_day to 1.

chinese_calendar($month, $year)

The difference between the generic_calendar is the return array, contain not only the day of the month, but also the Calendar::China date. And to address the start date of the new chinese month, the return value of the function contain two elements, one is the month calendar array, which like:

[ [ undef, undef, undef, undef, undef, [1, D], [2, D] ],
    ...
  [ [31, D], undef, undef, undef, undef, undef, undef ] ]

The D stands for Calendar::China date. The second element is an array of new chinese month date. A month may contain two new chinese month date.

AUTHOR

Ye Wenbin <wenbinye@gmail.com>

COPYRIGHT

Copyright (C) 2006 by ywb

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.7 or, at your option, any later version of Perl 5 you may have available.