|
MongerCalendar
MongerCalendar is an object oriented module that will permit you to easily access a plethora
of information about any given month in any year between 1800 and 2099.
MongerCalendar is a self contained module that does not require any other modules to function. It
was written to be placed in your webspace with the program calling it. It does NOT have to
be installed on the server. Simply place it in the same directory as the program calling it.
MongerCalendar offers a variety of methods and information specific to calendar months
and calendar weeks. A full description of accessing methods and information is contained
in the MongerCalendar.pm file at the end of the file. This page will provide a brief summary
of each of these methods and what they return. Before delving into that, have a quick look
at the following two demonstration scripts which both use MongerCalendar:
Monthly HTML Calendar
Weekly HTML Calendar
Here is a summary of the methods and information accessible through MongerCalendar:
- $obj->evaluate
Returns a list of information about the month including
the name of the current objects month; number of days in the current objects month, the previous month and the following
month; if the current objects year is a leap year; the name of the first day of the
current objects month; the name of the last day of the current objects month; the number
of sundays in the current objects month.
- $obj->is_a_leap_year
Returns true if the current objects year is a leap year, otherwise returns false.
- $obj->dayname
Returns the name of the day for any given day of the current objects month.
- $obj->weekday
Tells you the position in the calendar week for any day of the current objects month.
- $obj->calendar_week
Tells you which calendar week, within the current objects month, any given day of that month falls in.
Remember, there can only be a maximum of six calendar weeks in any given month (try it).
- $obj->month_name
Accepts any month as a number and returns the name of that month. You can have it return abbreviated and you can even have it return in French.
- $obj->month_number
Accepts the name (in letters) of any month (in English or French) and returns that months number (from 1 to 12).
- $obj->weeks_in_month
Returns the number of calendar weeks in the current objects month (there can only be a maximum of six, go ahead, try it).
- $obj->days_in_month
Returns the number of days in the current objects month.
- $obj->days_in_previous_month
Returns the number of days in the month prior to the current objects month.
- $obj->days_in_next_month
Returns the number of days in the month following the current objects month.
- $obj->week_definition
Returns a list of dates for each day (starting with Sunday, ending with Saturday) for any given calendar week within the current objects month.
For those calendar weeks that bleed over to the previous or following month, it will even return those partial dates of either the previous or following month.
Now go have another look at the demos again and you will see how all this information is
being put to use.
Monthly HTML Calendar
Weekly HTML Calendar
Download MongerCalendar.pm
If you have any suggestions for added methods or access to information for this module,
please contact us
|
|