NAME
Date::Holidays::KZ - Determine Kazakhstan official holidays and business days.
SYNOPSIS
use Date::Holidays::KZ qw( is_holiday holidays is_business_day );
my ( $year, $month, $day ) = ( localtime )[ 5, 4, 3 ];
$year += 1900;
$month += 1;
if ( my $holidayname = is_holiday( $year, $month, $day ) ) {
print "Today is a holiday: $holidayname\n";
}
my $ref = holidays( $year );
while ( my ( $md, $name ) = each %$ref ) {
print "On $md there is a holiday named $name\n";
}
if ( is_business_day( 2012, 03, 11 ) ) {
print "2012-03-11 is business day on weekend\n";
}
if ( is_short_business_day( 2015, 04, 30 ) ) {
print "2015-04-30 is short business day\n";
}
$Date::Holidays::KZ::strict=1;
# here we die because time outside from $HOLIDAYS_VALID_SINCE to $INACCURATE_TIMES_SINCE
holidays( 9001 );
$Date::Holidays::KZ::HOLIDAYS_VALID_SINCE, $Date::Holidays::KZ::INACCURATE_TIMES_SINCE
HOLIDAYS_VALID_SINCE before this year package doesn't matter INACCURATE_TIMES_SINCE after this year dates of holidays and working day shift are not accurate, but you can most likely be sure of historical holidays
$Date::Holidays::KZ::strict
Allows you to return an error if the requested date is outside the determined times. Default is 0.
is_holiday( $year, $month, $day )
Determine whether this date is a KZ holiday. Returns holiday name or undef.
is_kz_holiday( $year, $month, $day )
Alias for is_holiday().
holidays( $year )
Returns hash ref of all KZ holidays in the year.
is_business_day( $year, $month, $day )
Returns true if date is a business day in KZ taking holidays and weekends into account.
is_short_business_day( $year, $month, $day )
Returns true if date is a shortened business day in KZ.
LICENSE
This software is copyright (c) 2022 by Vladimir Varlamov.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Terms of the Perl programming language system itself
a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License"
AUTHOR
Vladimir Varlamov, <bes.internal@gmail.com>