.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "HTML::FormFu::Element::Date 3pm" .TH HTML::FormFu::Element::Date 3pm "2019-01-12" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" HTML::FormFu::Element::Date \- 3 select menu multi\-field .SH "VERSION" .IX Header "VERSION" version 2.07 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 10 \& \-\-\- \& elements: \& \- type: Date \& name: birthdate \& label: \*(AqBirthdate:\*(Aq \& day: \& prefix: "\- Day \-" \& month: \& prefix: "\- Month \-" \& year: \& prefix: "\- Year \-" \& less: 70 \& plus: 0 \& auto_inflate: 1 .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Creates a multi element containing 3 select menus for the day, month and year. .PP A date element named \f(CW\*(C`foo\*(C'\fR would result in 3 select menus with the names \&\f(CW\*(C`foo_day\*(C'\fR, \f(CW\*(C`foo_month\*(C'\fR and \f(CW\*(C`foo_year\*(C'\fR. The names can instead be overridden by the \f(CW\*(C`name\*(C'\fR value in \*(L"day\*(R", \*(L"month\*(R" and \*(L"year\*(R". .PP This element automatically merges the input parameters from the select menu into a single date parameter (and doesn't delete the individual menu's parameters). .SH "METHODS" .IX Header "METHODS" .SS "default" .IX Subsection "default" Arguments: DateTime object .PP Arguments: \f(CW$date_string\fR .PP Accepts either a DateTime object, or a string containing a date, matching the \*(L"strftime\*(R" format. Overwrites any default value set in \*(L"day\*(R", \&\*(L"month\*(R" or \*(L"year\*(R". .SS "default_natural" .IX Subsection "default_natural" Arguments: \f(CW$date_string\fR .PP .Vb 2 \& \- type: Date \& default_natural: \*(Aqtoday\*(Aq .Ve .PP Accepts a date/time string suitable for passing to \&\*(L"parse_datetime\*(R" in DateTime::Format::Natural. .SS "default_datetime_args" .IX Subsection "default_datetime_args" .Vb 4 \& \- type: Date \& default_natural: \*(Aqtoday\*(Aq \& default_datetime_args: \& set_time_zone: \*(AqEurope/London\*(Aq .Ve .PP Accepts a hashref of method-names / values that will be called on the \&\*(L"default\*(R" DateTime object, before the select fields' values are set from it. .SS "strftime" .IX Subsection "strftime" Default Value: \*(L"%d\-%m\-%Y\*(R" .PP The format of the date as returned by \*(L"params\*(R" in HTML::FormFu, if \&\*(L"auto_inflate\*(R" is not set. .PP If \*(L"auto_inflate\*(R" is used, this is still the format that the parameter will be in prior to the DateTime inflator being run; which is what any Filters and Constraints will receive. .SS "day" .IX Subsection "day" Arguments: \e%setting .PP Set values effecting the \f(CW\*(C`day\*(C'\fR select menu. Known keys are: .PP \fIname\fR .IX Subsection "name" .PP Override the auto-generated name of the select menu. .PP \fIdefault\fR .IX Subsection "default" .PP Set the default value of the select menu .PP \fIprefix\fR .IX Subsection "prefix" .PP Arguments: \f(CW$value\fR .PP Arguments: \e@values .PP A string or arrayref of strings to be inserted into the start of the select menu. .PP Each value is only used as the label for a select item \- the value for each of these items is always the empty string \f(CW\*(Aq\*(Aq\fR. .PP \fIprefix_loc\fR .IX Subsection "prefix_loc" .PP Arguments: \f(CW$localization_key\fR .PP Arguments: \e@localization_keys .PP A localized string or arrayref of localized strings to be inserted into the start of the select menu. .PP Each value is localized and then only used as the label for a select item \&\- the value for each of these items is always the empty string \f(CW\*(Aq\*(Aq\fR. .PP Use \f(CW\*(C`prefix_loc\*(C'\fR insted of \f(CW\*(C`prefix\*(C'\fR. .SS "month" .IX Subsection "month" Arguments: \e%setting .PP Set values effecting the \f(CW\*(C`month\*(C'\fR select menu. Known keys are: .PP \fIname\fR .IX Subsection "name" .PP Override the auto-generated name of the select menu. .PP \fIdefault\fR .IX Subsection "default" .PP Set the default value of the select menu .PP \fIprefix\fR .IX Subsection "prefix" .PP Arguments: \f(CW$value\fR .PP Arguments: \e@values .PP A string or arrayref of strings to be inserted into the start of the select menu. .PP Each value is only used as the label for a select item \- the value for each of these items is always the empty string \f(CW\*(Aq\*(Aq\fR. .PP \fIprefix_loc\fR .IX Subsection "prefix_loc" .PP Arguments: \f(CW$localization_key\fR .PP Arguments: \e@localization_keys .PP A localized string or arrayref of localized strings to be inserted into the start of the select menu. .PP Each value is localized and then only used as the label for a select item \&\- the value for each of these items is always the empty string \f(CW\*(Aq\*(Aq\fR. .PP Use \f(CW\*(C`prefix_loc\*(C'\fR insted of \f(CW\*(C`prefix\*(C'\fR. .PP \fInames\fR .IX Subsection "names" .PP Arguments: \e@months .PP A list of month names used for the month menu. .PP If not set, the list of month names is obtained from DateTime::Locale using the locale set in \*(L"languages\*(R" in HTML::FormFu. .PP \fIshort_names\fR .IX Subsection "short_names" .PP Argument: bool .PP If true (and \f(CW\*(C`months\*(C'\fR is not set) the list of abbreviated month names is obtained from DateTime::Locale using the locale set in \&\*(L"languages\*(R" in HTML::FormFu. .SS "year" .IX Subsection "year" Arguments: \e%setting .PP Set values effecting the \f(CW\*(C`year\*(C'\fR select menu. Known keys are: .PP \fIname\fR .IX Subsection "name" .PP Override the auto-generated name of the select menu. .PP \fIdefault\fR .IX Subsection "default" .PP Set the default value of the select menu .PP \fIprefix\fR .IX Subsection "prefix" .PP Arguments: \f(CW$value\fR .PP Arguments: \e@values .PP A string or arrayref of strings to be inserted into the start of the select menu. .PP Each value is only used as the label for a select item \- the value for each of these items is always the empty string \f(CW\*(Aq\*(Aq\fR. .PP \fIprefix_loc\fR .IX Subsection "prefix_loc" .PP Arguments: \f(CW$localization_key\fR .PP Arguments: \e@localization_keys .PP A localized string or arrayref of localized strings to be inserted into the start of the select menu. .PP Each value is localized and then only used as the label for a select item \&\- the value for each of these items is always the empty string \f(CW\*(Aq\*(Aq\fR. .PP Use \f(CW\*(C`prefix_loc\*(C'\fR insted of \f(CW\*(C`prefix\*(C'\fR. .PP \fIlist\fR .IX Subsection "list" .PP Arguments: \e@years .PP A list of years used for the year menu. .PP If this is set, \f(CW\*(C`reference\*(C'\fR, \f(CW\*(C`less\*(C'\fR and \f(CW\*(C`plus\*(C'\fR are ignored. .PP \fIreference\fR .IX Subsection "reference" .PP Arguments: \f(CW$year\fR .PP Default Value: the current year, calculated from \fBtime()\fR .PP If \f(CW\*(C`list\*(C'\fR is not set, the list is created from the range of \&\f(CW\*(C`reference \- year_less\*(C'\fR to \f(CW\*(C`reference + year_plus\*(C'\fR. .PP \fIless\fR .IX Subsection "less" .PP Arguments: \f(CW$count\fR .PP Default Value: 0 .PP \fIplus\fR .IX Subsection "plus" .PP Arguments: \f(CW$count\fR .PP Default Value: 10 .PP \fIreverse\fR .IX Subsection "reverse" .PP Arguments: bool .PP Default Value: 0 .PP If true, the list of years is listed in reverse (decreasing) order. .SS "field_order" .IX Subsection "field_order" Arguments: \e@fields .PP Default Value: ['day', 'month', 'year'] .PP Specify the order of the date fields in the rendered \s-1HTML.\s0 .PP Not all 3 fields are required. No single field can be used more than once. .SS "auto_inflate" .IX Subsection "auto_inflate" If true, a DateTime Inflator will automatically be added to the element, and it will be given a formatter so that stringification will result in the format specified in \*(L"strftime\*(R". .PP If you require the DateTime Inflator to have a different stringification format to the format used internally by your Filters and Constraints, then you must explicitly add your own DateTime Inflator, rather than using \&\*(L"auto_inflate\*(R". .SH "CAVEATS" .IX Header "CAVEATS" Although this element inherits from HTML::FormFu::Element::Block, its behaviour for the methods filter/filters, constraint/constraints, inflator/inflators, validator/validators and transformer/transformers is more like that of a field element, meaning all processors are added directly to the date element, not to its select-menu child elements. .PP This element's get_elements and get_all_elements are inherited from HTML::FormFu::Element::Block, and so have the same behaviour. However, it overrides the \f(CW\*(C`get_fields|HTML::FormFu/get_fields\*(C'\fR method, such that it returns both itself and its child elements. .SH "SEE ALSO" .IX Header "SEE ALSO" Is a sub-class of, and inherits methods from HTML::FormFu::Role::Element::Field, HTML::FormFu::Element::Multi, HTML::FormFu::Element::Block, HTML::FormFu::Element .PP HTML::FormFu .SH "AUTHOR" .IX Header "AUTHOR" Carl Franks, \f(CW\*(C`cfranks@cpan.org\*(C'\fR .SH "LICENSE" .IX Header "LICENSE" This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. .SH "AUTHOR" .IX Header "AUTHOR" Carl Franks .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2018 by Carl Franks. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.