1HTML::FormFu::Deflator:U:sSetrrfCtoinmter(i3b)uted PerlHDToMcLu:m:eFnotramtFiuo:n:Deflator::Strftime(3)
2
3
4
6 HTML::FormFu::Deflator::Strftime - Strftime deflator
7
9 $form->deflator( Strftime => 'start_time' )
10 ->strftime( '%d/%m/%Y' );
11
12 ---
13 elements:
14 - type: Text
15 inflators:
16 - type: DateTime
17 parser:
18 strptime: "%Y/%m/%d"
19 deflator:
20 - type: Strftime
21 strftime: "%Y/%m/%d"
22
24 Strftime deflator for DateTime objects.
25
26 When you redisplay a form to the user following an invalid submission,
27 any fields with DateTime inflators will stringify to something like
28 '1970-01-01T00:00:00'. In most cases it makes more sense to use the
29 same format you've asked the user for. This deflator allows you to
30 specify a more suitable and user-friendly format.
31
32 This deflator calls DateTime's "strftime" method. Possible values for
33 the format string are documented at
34 <http://search.cpan.org/dist/DateTime/lib/DateTime.pm#strftime_Patterns>.
35
36 If you set the form's locale (see "locale" in HTML::FormFu) this is set
37 on the DateTime object. Now you can use %x to get the default date or
38 %X for the default time for the object's locale.
39
41 Carl Franks, "cfranks@cpan.org"
42
44 This library is free software, you can redistribute it and/or modify it
45 under the same terms as Perl itself.
46
47
48
49perl v5.12.1 2010-05-16HTML::FormFu::Deflator::Strftime(3)