time
Description
Wpart responsible for handling the time data. Time values are kept inside the Erlang Virtual Machine as a tuples: {Hour, Minutes, Seconds}.
The rendered widget is <input type="text" ... />.
Validation
option |
format |
description |
error message |
format |
"Format" |
Defines the format of the time |
{bad_time_format, Input} or {bad_separator_in_time_form, Input} |
min |
{H, M, S} where H, M and S are integers |
Sets the lower bound of the entered time |
{bad_range, Input} |
max |
{H, M, S} where H, M and S are integers |
Sets the upper bound of the entered time |
{bad_range, Input} |
HTML meta-attributes
name |
format |
description |
format |
"Format" |
Specifies the format for the entered time. The available formats are listed below. The default format is HH:MM:SS. |
Formats
format |
description |
example (for a tuple: {9, 56, 23} |
HH |
hour |
09 |
NN |
minutes |
56 |
MM |
minutes (deprecated) |
56 |
SS |
seconds |
23 |
Other character |
passed through |
Other character |
Formatting examples
format |
input |
result |
HH:NN:SS |
{11, 10, 9} |
"11:10:09" |
SS seconds and NN minutes |
{1, 56, 33} |
"33 seconds and 56 minutes" |
Examples
Records definitions
...
{time, [{format, "HH NN SS"},
{min, {10, 20, 30}},
%% other parameters
]
},
...
HTML tag
<wpart:time format="HH NN SS" OTHER_HTML_ATTRIBUTES />
