Prima::Calendar - standard calendar widget
use Prima qw(Calendar Application); my $cal = Prima::Calendar-> create( useLocale => 1, size => [ 150, 150 ], onChange => sub { print $_[0]-> date_as_string, "\n"; }, ); $cal-> date_from_time( localtime ); $cal-> month( 5); run Prima;
Provides interactive selection for dates between the years 1900 and 2099. The main property, date, is a three-integer array of day, month, and year, in the format of perl localtime ( see "localtime" in perlfunc ) - day's range is between 1 and 31, month's 0 to 11, year's from 0 to 199.
Called when the date property is changed.
Accepts three integers in the format of localtime. DAY can be from 1 to 31, MONTH from 0 to 11, YEAR from 0 to 199.
localtime
Default value: today's date.
Selects the day in the month.
Selects the first day of the week, an integer between 0 and 6, where 0 is Sunday as the first day, 1 is Monday, etc.
Default value: 0
Selects the month
If 1, the locale-specific names of months and days of week are used. These are read by calling POSIX::strftime. If an invocation of the POSIX module fails, the property is automatically assigned to 0.
POSIX::strftime
If 0, the English names of months and days of week are used.
Default value: 1
See also: date_as_string
Selects the year.
Returns a boolean value, whether the locale information can be retrieved by calling strftime or not.
strftime
Returns the MONTH name according to the useLocale value.
Returns an array of the 12 month names according to the useLocale value.
Returns an integer value between 0 and 6, the day of week on DAY, MONTH, YEAR date. If boolean USE_FIRST_DAY_OF_WEEK is set, the value of the firstDayOfWeek property is taken into account, so f ex the result of 0 means that this is a Sunday shifted forward by firstDayOfWeek days.
firstDayOfWeek
The switch from the Julian to the Gregorian calendar is ignored.
Returns string representation of date on DAY, MONTH, YEAR according to the useLocale property value.
Copies date from localtime or gmtime results. This helper method allows the following syntax:
gmtime
$calendar-> date_from_time( localtime( time));
Dmitry Karasik, <dmitry@karasik.eu.org>.
Prima, Prima::Widget, POSIX, "localtime" in perlfunc, "time" in perlfunc, examples/calendar.pl.
To install Prima, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Prima
CPAN shell
perl -MCPAN -e shell install Prima
For more information on module installation, please visit the detailed CPAN module installation guide.