HTML::...terval(3pm)
π HTML::Microformats::Datatype::Interval π
okay bestie, welcome to HTML::Microformats::Datatype::Interval β it's the Perl module for concrete periods of time, and yes it's a mouthful, we just call it The Interval Module around here π
β¨ SYNOPSIS β¨
my $interval = HTML::Microformats::Datatype::Interval->new($span);
print "$interval\n";
like. that's it. that's the whole vibe check. π¦
πΈ DESCRIPTION πΈ
π Constructors π
$i = HTML::Microformats::Datatype::Interval->new($span)β bestie, this creates a brand newHTML::Microformats::Datatype::Intervalobject. iconic behaviour honestly.
$span is a DateTime::Span object. that's the whole assignment. no cap.
$i = HTML::Microformats::Datatype::Interval->parse($string, $elem, $context)β also makes a newHTML::Microformats::Datatype::Intervalobject, but from a string this time, main character energy β¨
$string is an interval represented in ISO 8601 format, for example: '2010-01-01/P1Y' or '2010-01-01/2011-01-01'. $elem is the XML::LibXML::Element being parsed. $context is the document context. π«Ά
This constructor supports a number of experimental microformat interval patterns. e.g.
<div class="interval">
<span class="d">4</span> days starting from
<abbr class="start" title="2010-01-01">2010</abbr>
</div>
not me showing you experimental microformat patterns, we love a little chaos π
π Public Methods π
$span = $i->spanβ hands you back aDateTime::Spanobject. slay.$span = $i->to_stringβ hands you back an ISO 8601 formatted string representing the interval. so basically it says what it is, out loud, in ISO. periodt. π$d->datatypeβ returns an the RDF datatype URI representing the data type of this literal. π (yes the original says "returns an the", we're keeping it, it's part of the lore now, no I will not be fixing it, it's canon)
β Function β
compare($a, $b)β compares intervals $a and $b. Return values are as per'cmp'(seeperlfunc). lowkey a classic.
π¨ not exported by default!! you have to ask for it, bestie. it's not just gonna show up.
Can also be used as a method:
$a->compare($b);
method mode unlocked π
π BUGS π
Please report any bugs to <http://rt.cpan.org/>. do it fr fr, they want to know π«Ά
π SEE ALSO π
HTML::MicroformatsHTML::Microformats::DatatypeDateTime::Span
the whole friend group, honestly. go say hi π
π AUTHOR π
Toby Inkster <tobyink@cpan.org>. thank you for your service, king π«‘
π COPYRIGHT AND LICENCE π
Copyright 2008-2012 Toby Inkster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
(yes that's the actual Perl licence terms, not me being vague on purpose, that's just how it be π )
π§ DISCLAIMER OF WARRANTIES π§
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
okay so this part is in ALL CAPS because it's the serious bit β no promises, no guarantees, use at your own risk, that's the deal π₯
and that's the whole page babes π this was perl v5.32.1, dated 2021-09-12, brought to you by HTML::...terval(3pm) β take care of her, she's vintage β¨πΈπ
π¦ where this page comes from
- debian bookworm: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libhtml-microformats-perl 0.105-6 Β· 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