Calendar::Japanese::Holiday - Japanese holidays in calender
use Calendar::Japanese::Holiday; # Getting a list of holidays $holidays = getHolidays(2008, 5); $holidays = getHolidays(2008, 5, 1); # Examining whether it is holiday or not. $name = isHoliday(2007, 5, 5);
This module treats holidays information in Japanese calendar. The list of holidays can be acquired, and you can examine whether a day is holiday or not. You can acquire the holiday name too.
Returns a hash reference that has holidays in $year/$month. Returns empty hash reference if no holidays. It returns substitute holidays too if $furikae is true. $furikae is false when $furikae is omitted. $year is supported after 1948. A undef is returned if error ocucred.
# Case 1 - $furikae is omitted $holidays = getHolidays(2008, 5); Return: $holidays = { '4' => "\x{307f}\x{3069}\x{308a}\x{306e}\x{65e5}", # Midori-no-hi '3' => "\x{61b2}\x{6cd5}\x{8a18}\x{5ff5}\x{65e5}", # Kenpou-Kinenbi '5' => "\x{3053}\x{3069}\x{3082}\x{306e}\x{65e5}" # Kodomo-no-hi }; # Case 2 - $furikae is true $holidays = getHolidays(2008, 5, 1); Return: $holidays = { '6' => "\x{632f}\x{66ff}", # Furikae '4' => "\x{307f}\x{3069}\x{308a}\x{306e}\x{65e5}", # Midori-no-hi '3' => "\x{61b2}\x{6cd5}\x{8a18}\x{5ff5}\x{65e5}", # Kenpou-Kinenbi '5' => "\x{3053}\x{3069}\x{3082}\x{306e}\x{65e5}" # Kodomo-no-hi }; # Case 3 - no holidays $holidays = getHolidays(2008, 6); Return: $holidays = {};
Returns holiday name. Returns undef if $year/$month/$day is not holiday. $furikae is same as getHolidays().
$name = isHoliday(2007, 5, 5); $name is "\x{3053}\x{3069}\x{3082}\x{306e}\x{65e5}" Kodomo-no-hi
http://wiki.bit-hive.com/tomizoo/pg/Perl%20%BD%CB%C6%FC%CC%BE%A4%CE%BC%E8%C6%C0
(In Japanese document)
Kazuyoshi Tomita, <kztomita@bit-hive.com>
Copyright (C) 2007 by Kazuyoshi Tomita
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.1 or, at your option, any later version of Perl 5 you may have available.
To install Calendar::Japanese::Holiday, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Calendar::Japanese::Holiday
CPAN shell
perl -MCPAN -e shell install Calendar::Japanese::Holiday
For more information on module installation, please visit the detailed CPAN module installation guide.