NAME
App::durseq - Generate a sequence of durations
VERSION
This document describes version 0.004 of App::durseq (from Perl
distribution App-durseq), released on 2019-11-29.
FUNCTIONS
durseq
Usage:
durseq(%args) -> [status, msg, payload, meta]
Generate a sequence of durations.
This utility is similar to Perl script dateseq, except that it generates
a sequence of durations instead of dates.
This function is not exported.
Arguments ('*' denotes required arguments):
* format_class => *perl::modname* (default: "ISO8601")
Use a DateTime::Format::Duration::* class for formatting.
By default, "ISO8601" (DateTime::Format::Duration::ISO8601) is used.
* format_class_attrs => *hash*
Arguments to pass to constructor of DateTime::Format::* class.
* from => *duration*
Starting duration.
* increment => *duration*
Increment, default is one day (P1D).
* limit => *int*
Only generate a certain amount of items.
* reverse => *true*
Decrement instead of increment.
* to => *duration*
Ending duration, if not specified will generate an infinite* stream
of durations.
Returns an enveloped result (an array).
First element (status) is an integer containing HTTP status code (200
means OK, 4xx caller error, 5xx function error). Second element (msg) is
a string containing error message, or 'OK' if status is 200. Third
element (payload) is optional, the actual result. Fourth element (meta)
is called result metadata and is optional, a hash that contains extra
information.
Return value: (any)
HOMEPAGE
Please visit the project's homepage at
<https://metacpan.org/release/App-durseq>.
SOURCE
Source repository is at <https://github.com/perlancar/perl-App-durseq>.
BUGS
Please report any bugs or feature requests on the bugtracker website
<https://rt.cpan.org/Public/Dist/Display.html?Name=App-durseq>
When submitting a bug or request, please include a test-file or a patch
to an existing test-file that illustrates the bug or desired feature.
AUTHOR
perlancar <perlancar@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2019 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.