Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

html::formfu::inflator::datetime(3pm) [debian man page]

HTML::FormFu::Inflator::DateTime(3pm)			User Contributed Perl Documentation		     HTML::FormFu::Inflator::DateTime(3pm)

NAME
HTML::FormFu::Inflator::DateTime - DateTime inflator SYNOPSIS
--- elements: - type: Text name: start_date inflators: - type: DateTime parser: strptime: '%d-%m-%Y' strptime: pattern: '%d-%b-%Y' locale: de - type: Text name: end_time inflators: - type: DateTime time_zone: Europe/Rome parser: regex: '^ (d{2}) - (d{2}) - (d{4}) $' params: [day, month, year] strptime: '%d-%m-%Y' An example of using the same parser declaration for both a DateTime constraint and a DateTime inflator, using YAML references: --- elements: - type: Text name: date constraints: - type: DateTime parser: &PARSER strptime: '%d-%m-%Y' inflators: - type: DateTime parser: *PARSER DESCRIPTION
Inflate dates into DateTime objects. For a corresponding deflator, see HTML::FormFu::Deflator::Strftime. METHODS
parser Arguments: \%args Required. Define the expected input string, so DateTime::Format::Builder knows how to inflate it into a DateTime object. Accepts arguments to be passed to "parser" in DateTime::Format::Builder. strptime Arguments: \%args Arguments: $string Optional. Define the format that should be used if the DateTime object is stringified. time_zone Arguments: $string Optional. You can pass along a time_zone in which the DateTime will be created. This is useful if the string to parse does not contain time zone information and you want the DateTime to be in a specific zone instead of the floating one (which is likely). Accepts a hashref of arguments to be passed to "new" in DateTime::Format::Strptime. Alternatively, accepts a single string argument, suitable for passing to "DateTime::Format::Strptime->new( pattern => $string )". AUTHOR
Carl Franks, "cfranks@cpan.org" LICENSE
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-01-23 HTML::FormFu::Inflator::DateTime(3pm)

Check Out this Related Man Page

HTML::FormFu::Element::Date(3pm)			User Contributed Perl Documentation			  HTML::FormFu::Element::Date(3pm)

NAME
HTML::FormFu::Element::Date - 3 select menu multi-field SYNOPSIS
--- elements: - type: Date name: birthdate label: 'Birthdate:' day: prefix: "- Day -" month: prefix: "- Month -" year: prefix: "- Year -" less: 70 plus: 0 auto_inflate: 1 DESCRIPTION
Creates a multi element containing 3 select menus for the day, month and year. A date element named "foo" would result in 3 select menus with the names "foo_day", "foo_month" and "foo_year". The names can instead be overridden by the "name" value in "day", "month" and "year". 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). METHODS
default Arguments: DateTime object Arguments: $date_string Accepts either a DateTime object, or a string containing a date, matching the "strftime" format. Overwrites any default value set in "day", "month" or "year". default_natural Arguments: $date_string - type: Date default_natural: 'today' Accepts a date/time string suitable for passing to "parse_datetime" in DateTime::Format::Natural. default_datetime_args - type: Date default_natural: 'today' default_datetime_args: set_time_zone: 'Europe/London' Accepts a hashref of method-names / values that will be called on the "default" DateTime object, before the select fields' values are set from it. strftime Default Value: "%d-%m-%Y" The format of the date as returned by "params" in HTML::FormFu, if "auto_inflate" is not set. If "auto_inflate" 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. day Arguments: \%setting Set values effecting the "day" select menu. Known keys are: name Override the auto-generated name of the select menu. default Set the default value of the select menu prefix Arguments: $value Arguments: @values A string or arrayref of strings to be inserted into the start of the select menu. Each value is only used as the label for a select item - the value for each of these items is always the empty string ''. prefix_loc Arguments: $localization_key Arguments: @localization_keys A localized string or arrayref of localized strings to be inserted into the start of the select menu. 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 ''. Use "prefix_loc" insted of "prefix". month Arguments: \%setting Set values effecting the "month" select menu. Known keys are: name Override the auto-generated name of the select menu. default Set the default value of the select menu prefix Arguments: $value Arguments: @values A string or arrayref of strings to be inserted into the start of the select menu. Each value is only used as the label for a select item - the value for each of these items is always the empty string ''. prefix_loc Arguments: $localization_key Arguments: @localization_keys A localized string or arrayref of localized strings to be inserted into the start of the select menu. 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 ''. Use "prefix_loc" insted of "prefix". names Arguments: @months A list of month names used for the month menu. If not set, the list of month names is obtained from DateTime::Locale using the locale set in "languages" in HTML::FormFu. short_names Argument: bool If true (and "months" is not set) the list of abbreviated month names is obtained from DateTime::Locale using the locale set in "languages" in HTML::FormFu. year Arguments: \%setting Set values effecting the "year" select menu. Known keys are: name Override the auto-generated name of the select menu. default Set the default value of the select menu prefix Arguments: $value Arguments: @values A string or arrayref of strings to be inserted into the start of the select menu. Each value is only used as the label for a select item - the value for each of these items is always the empty string ''. prefix_loc Arguments: $localization_key Arguments: @localization_keys A localized string or arrayref of localized strings to be inserted into the start of the select menu. 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 ''. Use "prefix_loc" insted of "prefix". list Arguments: @years A list of years used for the year menu. If this is set, "reference", "less" and "plus" are ignored. reference Arguments: $year Default Value: the current year, calculated from time() If "list" is not set, the list is created from the range of "reference - year_less" to "reference + year_plus". less Arguments: $count Default Value: 0 plus Arguments: $count Default Value: 10 reverse Arguments: bool Default Value: 0 If true, the list of years is listed in reverse (decreasing) order. field_order Arguments: @fields Default Value: ['day', 'month', 'year'] Specify the order of the date fields in the rendered HTML. Not all 3 fields are required. No single field can be used more than once. 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 "strftime". 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 "auto_inflate". 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. 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 "get_fields|HTML::FormFu/get_fields" method, such that it returns both itself and its child elements. SEE ALSO
Is a sub-class of, and inherits methods from HTML::FormFu::Element::_Field, HTML::FormFu::Element::Multi, HTML::FormFu::Element::Block, HTML::FormFu::Element HTML::FormFu AUTHOR
Carl Franks, "cfranks@cpan.org" LICENSE
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-01-23 HTML::FormFu::Element::Date(3pm)
Man Page