HTML::...teTime(3pm)
β¨ NAME β¨
HTML::FormFu::Constraint::DateTime β the DateTime constraint, bestie π
It's literally a constraint that makes sure your input can later be inflated into a DateTime object. Periodt.
πΈ VERSION πΈ
version 2.07 β yes she's got a version, she's official π
π SYNOPSIS π
okay so here's the whole vibe, look at this:
---
elements:
- type: Text
name: start_date
constraints:
- type: DateTime
parser:
strptime: '%d-%m-%Y'
- type: Text
name: end_time
constraints:
- type: DateTime
parser:
regex: !!perl/regexp '^(\d{2}) - (\d{2}) - (\d{4})$'
params: [day, month, year]
and here's the slay-est trick ever: using the same parser declaration for both a DateTime constraint and a DateTime inflator, with YAML references π§β¨
---
elements:
- type: Text
name: date
constraints:
- type: DateTime
parser: &PARSER
strptime: '%d-%m-%Y'
inflators:
- type: DateTime
parser: *PARSER
not the&PARSERand*PARSERdoing a little anchor-and-alias duet π«Ά iconic behaviour, honestly
π DESCRIPTION π
Her whole job? Make sure the input can later be inflated to a DateTime object. That's it. That's the gig. No cap. π
π₯ METHODS π₯
π parser
Arguments: \%args
Required. Like, you have to give her this, she will not guess π
Define the expected input string, so that DateTime::Format::Builder knows how to turn it into a DateTime object. π¦
It accepts arguments to be passed to "parser" in DateTime::Format::Builder. So whatever that one takes, she takes. iykyk π
π 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>
(yes bestie, he's listed twice β we love a double feature π)
π 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 β brought to you by perl v5.28.1 on 2019-01-12, and filed away under HTML::FormFu::Constraint::DateTime(3pm). mwah ππβ¨
π¦ 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