.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "HTML::FormHandler::Field::Date 3pm" .TH HTML::FormHandler::Field::Date 3pm "2022-03-25" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" HTML::FormHandler::Field::Date \- a date field with formats .SH "VERSION" .IX Header "VERSION" version 0.40068 .SH "SUMMARY" .IX Header "SUMMARY" This field may be used with the jQuery Datepicker plugin. .PP You can specify the format for the date using jQuery formatDate strings or DateTime strftime formats. (Default format is format => '%Y\-%m\-%d'.) .PP .Vb 10 \& d \- "%e" \- day of month (no leading zero) \& dd \- "%d" \- day of month (two digit) \& o \- "%{day_of_year}" \- day of the year (no leading zeros) \& oo \- "%j" \- day of the year (three digit) \& D \- "%a" \- day name short \& DD \- "%A" \- day name long \& m \- "%{day_of_month}" \- month of year (no leading zero) \& mm \- "%m" \- month of year (two digit) "%m" \& M \- "%b" \- month name short \& MM \- "%B" \- month name long \& y \- "%y" \- year (two digit) \& yy \- "%Y" \- year (four digit) \& @ \- "%s" \- Unix timestamp (ms since 01/01/1970) .Ve .PP For example: .PP .Vb 1 \& has_field \*(Aqstart_date\*(Aq => ( type => \*(AqDate\*(Aq, format => "dd/mm/y" ); .Ve .PP or .PP .Vb 1 \& has_field \*(Aqstart_date\*(Aq => ( type => \*(AqDate\*(Aq, format => "%d/%m/%y" ); .Ve .PP You can also set 'date_end' and 'date_start' attributes for validation of the date range. Use iso_8601 formats for these dates (\*(L"yyyy-mm-dd\*(R"); The dates can be specified either as a string, or as a subref; the subref is evaluated at validation time. .PP .Vb 1 \& has_field \*(Aqstart_date\*(Aq => ( type => \*(AqDate\*(Aq, date_start => "2009\-12\-25", date_end => sub { DateTime\->now\->ymd } ); .Ve .PP Customize error messages 'date_early' and 'date_late': .PP .Vb 3 \& has_field \*(Aqstart_date\*(Aq => ( type => \*(AqDate, \& messages => { date_early => \*(AqPick a later date\*(Aq, \& date_late => \*(AqPick an earlier date\*(Aq, } ); .Ve .SS "Using with \s-1HTML5\s0" .IX Subsection "Using with HTML5" If the field's form has its 'is_html5' flag active, then the field's rendering behavior changes in two ways: .IP "\(bu" 4 It will render as instead of type=\*(L"text\*(R". .IP "\(bu" 4 If the field's format is set to anything other than \s-1ISO\s0 date format (%Y\-%m\-%d), then attempting to render the field will result in a warning. .Sp (Note that the default value for the field's format attribute is, in fact, the \s-1ISO\s0 date format.) .SH "AUTHOR" .IX Header "AUTHOR" FormHandler Contributors \- see HTML::FormHandler .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2017 by Gerda Shank. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.