HTML::...::Date(3pm)

πŸ“¦
version 0.40068 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute

πŸ’– NAME πŸ’–

okay bestie, you're on the HTML::...::Date(3pm) page (User Contributed Perl Documentation), and it's the manual for HTML::FormHandler::Field::Date β€” a date field with formats ✨.

πŸŽ€ VERSION πŸŽ€

version 0.40068 πŸ‘‘

🌈 SUMMARY 🌈

This field may be used with the jQuery Datepicker plugin. πŸ¦‹

You can specify the format for the date using jQuery formatDate strings or DateTime strftime formats. (Default format is format => '%Y-%m-%d'.) periodt.

  • 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)

For example:

has_field 'start_date' => ( type => 'Date', format => "dd/mm/y" );

or

has_field 'start_date' => ( type => 'Date', format => "%d/%m/%y" );

You can also set date_end and date_start attributes for validation of the date range. Use iso_8601 formats for these dates ("yyyy-mm-dd"); the dates can be specified either as a string, or as a subref; the subref is evaluated at validation time. πŸ’…

has_field 'start_date' => ( type => 'Date', date_start => "2009-12-25", date_end => sub { DateTime->now->ymd } );

Customize error messages date_early and date_late:

has_field 'start_date' => ( type => 'Date,
    messages => { date_early => 'Pick a later date',
                  date_late  => 'Pick an earlier date', } );

✨ Using with HTML5 ✨

If the field's form has its is_html5 flag active, then the field's rendering behavior changes in two ways:

  • It will render as <input type="date" ... /> instead of type="text".
  • If the field's format is set to anything other than ISO date format (%Y-%m-%d), then attempting to render the field will result in a warning.
Note that the default value for the field's format attribute is, in fact, the ISO date format. πŸ’…

πŸ‘‘ AUTHOR πŸ‘‘

FormHandler Contributors β€” see HTML::FormHandler.

This software is copyright (c) 2017 by Gerda Shank.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


okay that's the whole page, bestie 🫢 this one is from perl v5.34.0, dated 2022-03-25, and the manual name is HTML::...::Date(3pm) β€” mwah πŸ’‹.

πŸ“¦ where this page comes from