NAME

Prima::Widget::Time - standard time input widget

SYNOPSIS

use Prima qw(Application Widget::Time);

my $mw = Prima::MainWindow->new;
$mw->insert( 'Widget::Time' =>
	pack => { fill => 'x', pad => 20 },
);

run Prima;

DESCRIPTION

Standard time input widget derived from the Prima::InputLine class.

API

Methods

time2str TIME

Converts the TIME to a string representation according to the current format string

default_format

Returns a string to be used in format where the string is constructed to reflect the formatting of the regional time preferences.

See also: man 3 strftime, %X .

str2time STRING

Tries to extract time from STRING, assuming it is constructed according to the current format string. Doesn't fail but values that could not be extracted are assigned to the current second/minute/hour instead.

validate_time S, M, H

Checks whether S, M, H form a valid point in time, adjusts the values if not. Returns the corrected values.

Properties

format STRING

The format string is used when converting the time to its visual interpretation, also with regional preferences, f ex hh:mm:ss or hh:mm:AA . The syntax of the format is verbatim as this, i e it recognizes fixed patterns hh, mm, ss, aa, and AA, replacing them with the time values.

(aa is for <am / pm>, AA is for <AM / PM>).

hour

Selects the hour.

minute

Selects the minute.

second INTEGER

Selects the second

time SEC, MIN, HOUR | [ SEC, MIN, HOUR ]

Accepts three integers / arrayref with three integers in the format of localtime. SEC and MIN can be from 0 to 59, and HOUR from 0 to 23.

Default value: today's time.

AUTHOR

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

SEE ALSO

Prima::InputLine