HTML::...ateTime(3pm)

πŸ“¦
version 2.07000 Β· 5 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– NAME πŸ’–

HTML::FormFu::Element::DateTime β€” it's literally a Date / Time combo field, bestie ✨

(and yes, this is the page you'd find listed as HTML::...ateTime(3pm) under the User Contributed Perl Documentation, iykyk πŸ’…)


πŸ”₯ VERSION πŸ”₯

version 2.07 β€” that's the one, no cap 🫢


✨ SYNOPSIS ✨

---
elements:
  - type: DateTime
    name: start_datetime
    label: 'Start:'
    auto_inflate: 1

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this is a sub-class of the Date element, and the whole point of it is that it brings extra "hour" and "minute" Select menus along with it. Main character energy fr πŸŽ€


πŸ’… METHODS πŸ’…

πŸ• hour

Arguments: \%setting

This sets the values that affect the "hour" select menu. The known keys are:

  • name β€” overrides the auto-generated name of the select menu ✨
  • default β€” sets the default value of the select menu πŸ’–
  • prefix
    • Arguments: $value
    • Arguments: \@values

A string, or an arrayref of strings, that gets inserted into the start of the select menu.

Each value is only used as the label for a select item β€” the value for each of these items is always the empty string ''. Like, the label is doing all the work, the value is just there, vibes only πŸ™ˆ

  • prefix_loc
    • Arguments: $localization_key
    • Arguments: \@localization_keys

A localized string, or an arrayref of localized strings, that gets inserted into the start of the select menu.

Each value gets localized and then is only used as the label for a select item β€” the value for each of these items is always the empty string ''. Same deal as above, just ✨localized✨

Use "prefix_loc" insted of "prefix" 🌸

πŸ• minute

Arguments: \%setting

This one sets the values that affect the "minute" select menu. Known keys:

  • name β€” override the auto-generated name of the select menu πŸ‘‘
  • default β€” set the default value of the select menu πŸ’œ
  • prefix
    • Arguments: $value
    • Arguments: \@values

A string or arrayref of strings to be inserted into the start of the select menu.

Each value is only used as the label for a select item β€” the value for each of these items is always the empty string ''. Periodt πŸ’…

  • prefix_loc
    • Arguments: $localization_key
    • Arguments: \@localization_keys

A localized string or arrayref of localized strings to be inserted into the start of the select menu.

Each value is localized and then only used as the label for a select item β€” the value for each of these items is always the empty string ''. 🌈

Use "prefix_loc" insted of "prefix" 🧚

πŸ• second

Arguments: \%setting

And this one sets the values that affect the "second" select menu. Known keys:

  • name β€” override the auto-generated name of the select menu ⭐
  • default β€” set the default value of the select menu πŸ“
  • prefix
    • Arguments: $value
    • Arguments: \@values

A string or arrayref of strings to be inserted into the start of the select menu.

Each value is only used as the label for a select item β€” the value for each of these items is always the empty string ''. 😭

  • prefix_loc
    • Arguments: $localization_key
    • Arguments: \@localization_keys

A localized string or arrayref of localized strings to be inserted into the start of the select menu.

Each value is localized and then only used as the label for a select item β€” the value for each of these items is always the empty string ''. πŸ”₯

Use "prefix_loc" insted of "prefix" πŸ’–

πŸ“‹ field_order

Arguments: \@fields

Default Value: ['day', 'month', 'year', 'hour', 'minute']

This is the one that specifies the order of the date fields in the rendered HTML. The way that you get to control the lineup... iconic honestly πŸ‘‘

Heads up bestie: if you want the "second" selector to display, you have to set both "/field_order" and strftime yourself. Like, both. Not one. Both. 🚨

Eg:

elements:
  type: DateTime
  name: foo
  strftime: '%d-%m-%Y %H:%M:%S'
  field_order: ['day', 'month', 'year', 'hour', 'minute', 'second']

Not all fields are required. No single field can be used more than once. That's the rule, don't fight it πŸ™…β€β™€οΈ


πŸ’€ CAVEATS πŸ’€

See "CAVEATS" in HTML::FormFu::Element::Date β€” go read that one too, fr fr 🫢


🌈 SEE ALSO 🌈

Is a sub-class of, and inherits methods from HTML::FormFu::Element::Date

  • HTML::FormFu::Role::Element::Field, HTML::FormFu::Element::Multi, HTML::FormFu::Element::Block, HTML::FormFu::Element
  • HTML::FormFu

🌸 AUTHOR 🌸

Carl Franks, cfranks@cpan.org πŸ’Œ


πŸ“œ LICENSE πŸ“œ

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


🌟 AUTHOR 🌟

Carl Franks <cpan@fireartist.com>


This software is copyright (c) 2018 by Carl Franks.

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, slay πŸ’…βœ¨ this little writeup came to you courtesy of perl v5.28.1, dated 2019-01-12 β€” go forth and build your date/time combos, mwah πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from