NAME

Prima::Widget::Time - time inputline

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 inputline

API

Methods

time2str TIME

Converts TIME to string representation according to the current format string

default_format

Returns a string to be used in format, where the string is constructed in such a way to reflect regional time formatting 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 current second/minute/hour instead.

validate_time S, M, H

Checks whether S, M, H values are valid and within understood range; adjusts the values if not. Returns the final values.

Properties

format STRING

The format string is used when converting time to its visual interpretation, also with regional preferences, like hh:mm:ss or hh:mm:AA . The syntax of the format is exctly this, 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 format of localtime. SEC and MIN can be from 0 to 59, HOUR from 0 to 23.

Default value: today's time.

AUTHOR

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

SEE ALSO

Prima::InputLine