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
            parser:
              regex: '^ (\d{2}) - (\d{2}) - (\d{4}) $'
              params: [day, month, year]
            strptime: '%d-%m-%Y'

DESCRIPTION

Inflate dates into DateTime objects.

METHODS

parser

Arguments: \%args

Required. Define the expected input string, so DataTime::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.

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.