new(date)
url($day_number,$url)
url_all($url)
date_source()
draw()
date()
set_date(date)
ePortal::HTML::Calendar - Calendar dialog box.
This module is used to make a dialog with a monthly calendar.
% $Calendar = new ePortal::HTML::Calendar; % $Calendar->url_all('self'); ... <% $Calendar->draw %>
new(date)
Object contructor. date is passed to set_date
. Calendar's date may be
got from session hash or URL. The date source may be checked with
date_source()
member function.
A value of self means that date was initialized by Calendar.pm itself, session means that date was restored from user's session hash, url - from browsers's request.
Constructs self referencing URL removing all myself specific parameters. New parameters should be passed to this function to make them added to URL.
Returns URL with parameters.
url($day_number,$url)
Sets an URL for particular day in the current month view. If $url eq 'self' than self-refence URL will be contructed without parameters loss.
url_all($url)
Sets an url for each day in calendar. $url parameter is passed to url()
method. See it for details
date_source()
Returns a sting which points to a source of the date
self - self initialized date (today)
session - restored from user's session hash
url - adjusted from URL
draw()
Draws the calendar. Returns an HTML in array context and outputs HTML via $m in scalar context.
date()
Returns a date selected. It returns an array (YYYY,MM,DD) in array context and nicely formatted date 'DD.MM.YYYY' in scalar context.
set_date(date)
Adjust the calendar to the date. Parameter may be:
'now' or 'today' - set the date to today
'cal_nmon','next' or 'cal_pmon','prev' - adjust to next or prev month
[YYYY,MM,DD] - array ref to (YYYY,MM,DD)
(YYYY,MM,DD) - array of (YYYY,MM,DD)
'DD.MM.YYYY' - date as string
Sergey Rusakov, <rusakov_sa@users.sourceforge.net>