1HTML::FormFu::Inflator:U:sDearteCToinmter(i3b)uted PerlHDToMcLu:m:eFnotramtFiuo:n:Inflator::DateTime(3)
2
3
4
6 HTML::FormFu::Inflator::DateTime - DateTime inflator
7
9 ---
10 elements:
11 - type: Text
12 name: start_date
13 inflators:
14 - type: DateTime
15 parser:
16 strptime: '%d-%m-%Y'
17 strptime:
18 pattern: '%d-%b-%Y'
19 locale: de
20
21 - type: Text
22 name: end_time
23 inflators:
24 - type: DateTime
25 time_zone: Europe/Rome
26 parser:
27 regex: '^ (\d{2}) - (\d{2}) - (\d{4}) $'
28 params: [day, month, year]
29 strptime: '%d-%m-%Y'
30
31 An example of using the same parser declaration for both a DateTime
32 constraint and a DateTime inflator, using YAML references:
33
34 ---
35 elements:
36 - type: Text
37 name: date
38 constraints:
39 - type: DateTime
40 parser: &PARSER
41 strptime: '%d-%m-%Y'
42 inflators:
43 - type: DateTime
44 parser: *PARSER
45
47 Inflate dates into DateTime objects.
48
49 For a corresponding deflator, see HTML::FormFu::Deflator::Strftime.
50
52 parser
53 Arguments: \%args
54
55 Required. Define the expected input string, so
56 DateTime::Format::Builder knows how to inflate it into a DateTime
57 object.
58
59 Accepts arguments to be passed to "parser" in
60 DateTime::Format::Builder.
61
62 strptime
63 Arguments: \%args
64
65 Arguments: $string
66
67 Optional. Define the format that should be used if the DateTime object
68 is stringified.
69
70 time_zone
71 Arguments: $string
72
73 Optional. You can pass along a time_zone in which the DateTime will be
74 created. This is useful if the string to parse does not contain time
75 zone information and you want the DateTime to be in a specific zone
76 instead of the floating one (which is likely).
77
78 Accepts a hashref of arguments to be passed to "new" in
79 DateTime::Format::Strptime. Alternatively, accepts a single string
80 argument, suitable for passing to "DateTime::Format::Strptime->new(
81 pattern => $string )".
82
84 Carl Franks, "cfranks@cpan.org"
85
87 This library is free software, you can redistribute it and/or modify it
88 under the same terms as Perl itself.
89
90
91
92perl v5.12.1 2010-05-23HTML::FormFu::Inflator::DateTime(3)