﻿// JavaScript Document
<!--
function holyday_flg(year,month,date,nday){
	//定休日などはここで設定します。
	nofw    = Math.floor((date - 1) / 7) + 1;
	ldofw    = Math.floor((date - 2) / 7) + 1;
	shunbun = Math.floor(20.8431+0.242194*(year-1980)-Math.floor((year-1980)/4));
	syubun  = Math.floor(23.2488+0.242194*(year-1980)-Math.floor((year-1980)/4));

	if (month ==  12 && date ==  30)               { return 1; } // 年末
	if (month ==  12 && date ==  31)               { return 1; } // ねんまつ
	if (month ==  1 && date ==  1)               { return 1; } // 元旦
	if (month ==  1 && date ==  2)               { return 1; } // 三が日
	if (month ==  1 && date ==  3)               { return 1; } // 三が日
	if (month ==  1 && date ==  4)               { return 1; } // 正月休み
	
	
	if (month ==  1 && nday ==  1 && nofw ==  2) { return 1; } // 成人の日
	if (month ==  2 && date == 11)               { return 1; } // 建国記念の日
	if (month ==  3 && date == shunbun)          { return 1; } // 春分の日
	if (month ==  4 && date == 29)               { return 1; } // 昭和の日
	if (month ==  5 && date >=  3 && date <=  5) { return 1; } // GW
	if (month ==  7 && nday ==  1 && nofw ==  3) { return 1; } // 海の日
	if (month ==  9 && nday ==  1 && nofw ==  3) { return 1; } // 敬老の日
	if (month ==  9 && date == syubun)           { return 1; } // 秋分の日
	if (month ==  9 && nday ==  2 && ldofw ==  3 && date+1 == syubun) { return 1; }  // 前日が9月第3月曜で翌日が秋分の日の場合の火曜日→国民の休日
	if (month == 10 && nday ==  1 && nofw ==  2) { return 1; } // 体育の日
	
	if (month == 11 && date ==  3)               { return 1; } // 文化の日
	if (month == 11 && date == 23)               { return 1; } // 勤労感謝の日
	if (month == 12 && date == 23)               { return 1; } // 天皇誕生日
	
	if (month ==  8 && date ==  12)             { return 1; } // お盆休み
	if (month ==  8 && date ==  13)             { return 1; } // お盆休み
	if (month ==  8 && date ==  14)             { return 1; } // お盆休み
	if (month ==  8 && date ==  15)             { return 1; } // お盆休み
	
	if (nday  ==  0)                             { return 1; } // 日曜
	if (nday  ==  6 && nofw ==  2)				 { return 1; } //第2土曜
	if (nday  ==  6 && nofw ==  4)				 { return 1; } //第4土曜
	
	//振替休日の設定（前日が祝日の日曜日の場合）
	if (month ==  2 && date ==  12 && nday-1==0) { return 1; } // 建国記念の日の振替休日
	if (month ==  3 && date == shunbun+1 && nday-1==0)          { return 1; } // 春分の日の振替休日
	if (month ==  4 && date ==  30 && nday-1==0) { return 1; } // 昭和の日の振替休日
	if (month ==  5 && date ==  6 && nday>=1 && nday<=3) { return 1;} // GWの振替休日
	if (month ==  11 && date ==  4 && nday-1==0) { return 1; }// 文化の日の振替休日
	if (month ==  11 && date ==  24 && nday-1==0) { return 1; } // 勤労感謝の日の振替休日
	if (month ==  12 && date ==  24 && nday-1==0) { return 1; } // 天皇誕生日
	
	if (year == 2010 && month ==  7 && date ==  21)             { return 1; } // 社員研修臨時休業
	if (year == 2010 && month ==  7 && date ==  22)             { return 1; } // 社員研修臨時休業
	if (year == 2011 && month ==  7 && date ==  19)             { return 1; } // 台風の為臨時休業
    if (year == 2011 && month ==  7 && date ==  30)             { return 1; } // 棚卸しの為
	return 0;
}
//-->

