HTML::...teTime(3pm)
π HTML::FormFu::Deflator::CompoundDateTime π
okay bestie, so this page lives in the User Contributed Perl Documentation section of your man pages, and it's literally all about one little deflator. periodt. let's get into it π«Ά
β¨ NAME β¨
HTML::FormFu::Deflator::CompoundDateTime β the CompoundDateTime deflator, no cap π
πΈ VERSION πΈ
version 2.07 β that's the one, that's the vibe π
π¦ SYNOPSIS π¦
here's how you set it up, fr fr:
---
element:
- type: Multi
name: date
elements:
- name: day
- name: month
- name: year
deflator:
- type: CompoundDateTime
and then to set the default, you do this:
# set the default
$form->get_field('date')->default( $datetime );
slay. that's the whole flow. β¨
π DESCRIPTION π
so this deflator is made for when you're working with a HTML::FormFu::Element::Multi group of fields β you know, a lil squad of inputs that are all lowkey about the same thing. π
what it does: it takes one single DateTime value and sets the default values of several fields from it. one source of truth, many fields. main character energy honestly.
by default, it expects the field names to be any of the following:
yearmonthdayhourminutesecondnanosecondtime_zone
that's the standard lineup. if your fields are named like that, you're already winning. π
π METHODS π
π field_order π
Arguments: \@order
okay so if your field names don't follow the convention listed above, that's totally fine, you just gotta help a girl out β you must provide an arrayref containing the above names, in the order they correspond with your own fields. π§
like this:
---
element:
- type: Multi
name: date
elements:
- name: m
- name: d
- name: y
deflator:
- type: CompoundDateTime
field_order:
- month
- day
- year
see how m, d, y map to month, day, year? iconic. the order you list them in is the order that matters, iykyk. π
π AUTHOR π
Carl Franks
π 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>
β COPYRIGHT AND LICENSE β
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.
and that's the whole page bestie!! no notes, ate and left no crumbs π
this was perl v5.28.1, dated 2019-01-12, and it's still out here being HTML::FormFu::Deflator::CompoundDateTime coded. stay slaying, go format some datetimes πΈπ
β¨
π¦ where this page comes from
- debian bookworm: libhtml-formfu-perl 2.07000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libhtml-formfu-perl 2.07000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-formfu-perl 2.07000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms