1HTML::FormFu::Inflator:U:sDearteCToinmter(i3b)uted PerlHDToMcLu:m:eFnotramtFiuo:n:Inflator::DateTime(3)
2
3
4

NAME

6       HTML::FormFu::Inflator::DateTime - DateTime inflator
7

VERSION

9       version 2.06
10

SYNOPSIS

12           ---
13           elements:
14             - type: Text
15               name: start_date
16               inflators:
17                 - type: DateTime
18                   parser:
19                     strptime: '%d-%m-%Y'
20                   strptime:
21                     pattern: '%d-%b-%Y'
22                     locale: de
23
24             - type: Text
25               name: end_time
26               inflators:
27                 - type: DateTime
28                   time_zone: Europe/Rome
29                   parser:
30                     regex: '^ (\d{2}) - (\d{2}) - (\d{4}) $'
31                     params: [day, month, year]
32                   strptime: '%d-%m-%Y'
33
34       An example of using the same parser declaration for both a DateTime
35       constraint and a DateTime inflator, using YAML references:
36
37           ---
38           elements:
39             - type: Text
40               name: date
41               constraints:
42                 - type: DateTime
43                   parser: &PARSER
44                     strptime: '%d-%m-%Y'
45               inflators:
46                 - type: DateTime
47                   parser: *PARSER
48

DESCRIPTION

50       Inflate dates into DateTime objects.
51
52       For a corresponding deflator, see HTML::FormFu::Deflator::Strftime.
53

METHODS

55   parser
56       Arguments: \%args
57
58       Required. Define the expected input string, so
59       DateTime::Format::Builder knows how to inflate it into a DateTime
60       object.
61
62       Accepts arguments to be passed to "parser" in
63       DateTime::Format::Builder.
64
65   strptime
66       Arguments: \%args
67
68       Arguments: $string
69
70       Optional. Define the format that should be used if the DateTime object
71       is stringified.
72
73   time_zone
74       Arguments: $string
75
76       Optional. You can pass along a time_zone in which the DateTime will be
77       created. This is useful if the string to parse does not contain time
78       zone information and you want the DateTime to be in a specific zone
79       instead of the floating one (which is likely).
80
81       Accepts a hashref of arguments to be passed to "new" in
82       DateTime::Format::Strptime. Alternatively, accepts a single string
83       argument, suitable for passing to "DateTime::Format::Strptime->new(
84       pattern => $string )".
85

AUTHOR

87       Carl Franks, "cfranks@cpan.org"
88

LICENSE

90       This library is free software, you can redistribute it and/or modify it
91       under the same terms as Perl itself.
92

AUTHOR

94       Carl Franks <cpan@fireartist.com>
95
97       This software is copyright (c) 2018 by Carl Franks.
98
99       This is free software; you can redistribute it and/or modify it under
100       the same terms as the Perl 5 programming language system itself.
101
102
103
104perl v5.28.0                      2018-04-09HTML::FormFu::Inflator::DateTime(3)
Impressum