Prima::Calendar(3)

NAME
Prima::Calendar - standard calendar widget

DESCRIPTION
Provides interactive selection of a date between 1900 and 2099 years. The main property, the date manpage, is a three-integer array, day, month, and year, if the format of perl localtime ( see the localtime entry in the perlfunc manpage ) - day can be in range from 0 to 30,month from 0 to 11, year from 0 to 199.

SYNPOSIS
   use Prima::Calendar;
   my $cal = Prima::Calendar-> create(
      useLocale => 1,
      onChange  => sub {
         print $_[0]-> date_as_string, "\n";
      },
   );
   $cal-> date_from_time( localtime( time));
   $cal-> month( 5);

API

  Events

Change
    Called when the the date manpage property is changed.

  Properties

date DAY, MONTH, YEAR
    Accepts three integers in format of "localtime". DAY can be from 0 to 30, MONTH from 0 to 11, YEAR from 0 to 199.

    Default value: today's date.

day INTEGER
    Selects the day in month.

month
    Selects the month.

useLocale BOOLEAN
    If 1, the locale-specified names of months and days of week are used. These are read by calling "POSIX::strftime". If invoking POSIX module is failed, the property is automatically assigned to 0.

    If 0, the english names of months and days of week are used.

    Default value: 1

    See also: the date_as_string manpage

year
    Selects the year.

  Methods

can_use_locale
    Returns boolean value, whether the locale information can be retrieved by calling "strftime".

month2str MONTH
    Returns MONTH name accoring to the useLocale manpage value.

make_months
    Returns array of 12 month names accoring to the useLocale manpage value.

day_of_week DAY, MONTH, YEAR
    Returns integer value, from 0 to 6, of the day of week on DAY, MONTH, YEAR date. The switch from Julian to Gregorian calendar is ignored.

date_as_string [ DAY, MONTH, YEAR ]
    Returns string representation of date on DAY, MONTH, YEAR according to the useLocale manpage property value.

date_from_time SEC, MIN, HOUR, M_DAY, MONTH, YEAR, ...
    Copies the date manpage from "localtime" or "gmtime" result. This helper method allows the following syntax:

        $calendar-> date_from_time( localtime( time));

AUTHOR
Dmitry Karasik, <dmitry@karasik.eu.org>.

SEE ALSO
the Prima manpage, the Prima::Widget manpage, the POSIX manpage, the localtime entry in the perlfunc manpage, the time entry in the perlfunc manpage, examples/calendar.pl.