= Calendar::Japanese::Holiday
Author:: yy http://dishhh.jp/
Version:: 1.1
License:: MIT
== Description
���{�̏j�����������W���[���B
Date�ATime�ADateTime �N���X�� Calendar::Japanese::Holiday ���W���[���� Mix-in ���邱�ƂŁA
���{�̏j�������擾����@�\���lj������B
Date�ATime�ADateTime �ȊO�̃N���X�ł����Ă� year�Amonth�Aday �����N���X�ł���Η��p���邱�Ƃ��ł���B
�x�����ǂ�����Ԃ�
date.holiday?
�j���̖��O��Ԃ�
date.holiday
�y�����ǂ�����Ԃ�
date.weekend?
�j�����ǂ�����Ԃ�
date.national_holiday?
�U�x�����ǂ�����Ԃ�
date.substitute_holiday?
Holiday#holiday?() ���\�b�h�́uweekend? or national_holiday? or substitute_holiday?�v�Ɠ����B
���̂��ߏj���݂̂肵�����ꍇ�� national_holiday?() �� substitute_holiday?() ���\�b�h���g�p����B
Holiday#holiday() ���\�b�h�Ŏ擾�����j�����͓��{��}���`�o�C�g���������A
�g�p����镶���R�[�h�̓v���b�g�t�H�[���ɉ����Ď����I�ɑI�������B
��������ɕ����R�[�h���擾�ł��Ȃ��ꍇ�́A
Holiday.set_nkf_opts() ���\�b�h��p���Ė����I�ɕ����R�[�h���w�肷�邱�Ƃ��ł���B
���̃X�N���v�g�͎R�{�Ă���́u�j���Ή��J�����_�[�v���x�[�X�ɂ��Ă��܂��B
[�u�j���Ή��J�����_�[�v]
http://itdict.ddo.jp/~yamamoto/Script/Calendar/
== Install
=== gem
sudo gem install calendar-japanese-holiday
=== svn
svn co svn://rubyforge.org/var/svn/calendar-japanese-holiday/trunk ./
=== tgz
download: http://rubyforge.org/projects/calendar-japanese-holiday
== Sample
=== case 1
require 'calendar/japanese/holiday'
require 'date'
Date �N���X�� Mix-in ����
class Date
include Calendar::Japanese::Holiday
end
today = Date.today
if today.national_holiday?
puts today.holiday
end
=== case 2
Time �I�u�W�F�N�g�� Mix-in ����
puts Time.now.extend(Calendar::Japanese::Holiday).holiday
=== case 3
Mix-in �����ɗ��p���� (deprecated)
holiday = Calendar::Japanese::Holiday.holiday_info Time.now
puts holiday.name if info.is_national
=== case 4
�����R�[�h�������I�� EUC �Ɏw�肷��
Calendar::Japanese::Holiday.set_opts "-e"
puts Date.parse("2008-01-01").extend(Calendar::Japanese::Holiday).holiday