NAME

WWW::AzimuthAero::Utils - functions that can be used outside WWW::AzimuthAero::* packages

VERSION

version 0.31

DESCRIPTION

Some useful date manipulation and filtering functions

FUNCTIONS

get_next_dow_date

Get next dow-date following by specified date

By default all input and output dates in '%d.%m.%Y' format, but you can easily specified needed one or deturn DateTime object

get_next_dow_date( '7.06.2019', 7 )->dmy('.');  # '9.06.2019'
get_next_dow_date( '7.06.2019', 3 )->dmy('.');  # '12.06.2019'

get_dates_from_dows

Get particular dates, based on min_date, max_date and days_of_week

min_date and max_date are in '%Y-%m-%d' format by default

get_dates_from_dows( min => '2019-06-01', max => '2019-10-26', 'days' => '16' );

Return sorted array

TO-DO: carefully check for max day without min day (result may not include it)

get_dates_from_range

sort_dates

filter_dates

Filter dates by max and min dates

filter_dates( \@dates, max => '15.06.2019' );
filter_dates( \@dates, max => '15.06.2019', min => '07.06.2019' );

extract_js_glob_var

Extract global variable value from JavaScript code

fix_html_string

remove newline symbols, leading and trailing whitespaces

pairwise

Transform

[ [ 'ROV', 'MOW', 'LED' ], [ 'ROV', 'KRR', 'LED' ] ]

to

[ 
    { from => 'ROV', via => 'MOW', to => 'LED' },
    { from => 'ROV', via => 'KRR', to => 'LED' }
]

AUTHOR

Pavel Serikov <pavelsr@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2019 by Pavel Serikov.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.