Implementation
final constants = {
// 祝日を取得する年の最小
'from': 1949,
// 祝日を取得する年の最大
'to': 2099,
// 振替休日の施行日と名称
'furikaeKyuujitsu': {
'from': DateTime(1973, 4, 12),
'name': '振替休日',
},
// 国民の休日の施行日と名称
'kokuminNoKyuujitsu': {
'from': DateTime(1985, 12, 27),
'name': '国民の休日',
},
// 固定日
// month: 1月は1
'fixed': [
{'from': 1949, 'to': null, 'month': 1, 'date': 1, 'name': '元日'},
{'from': 1949, 'to': 1999, 'month': 1, 'date': 15, 'name': '成人の日'},
{'from': 1967, 'to': null, 'month': 2, 'date': 11, 'name': '建国記念の日'},
{'from': 2020, 'to': null, 'month': 2, 'date': 23, 'name': '天皇誕生日'},
{'from': 1989, 'to': 1989, 'month': 2, 'date': 24, 'name': '昭和天皇の大喪の礼'},
{'from': 1959, 'to': 1959, 'month': 4, 'date': 10, 'name': '皇太子明仁親王の結婚の儀'},
{'from': 1949, 'to': 1988, 'month': 4, 'date': 29, 'name': '天皇誕生日'},
{'from': 1989, 'to': 2006, 'month': 4, 'date': 29, 'name': 'みどりの日'},
{'from': 2007, 'to': null, 'month': 4, 'date': 29, 'name': '昭和の日'},
{'from': 2019, 'to': 2019, 'month': 5, 'date': 1, 'name': '即位の日'},
{'from': 1949, 'to': null, 'month': 5, 'date': 3, 'name': '憲法記念日'},
{'from': 2007, 'to': null, 'month': 5, 'date': 4, 'name': 'みどりの日'},
{'from': 1949, 'to': null, 'month': 5, 'date': 5, 'name': 'こどもの日'},
{'from': 1993, 'to': 1993, 'month': 6, 'date': 9, 'name': '皇太子徳仁親王の結婚の儀'},
{'from': 1996, 'to': 2002, 'month': 7, 'date': 20, 'name': '海の日'},
{'from': 2020, 'to': 2020, 'month': 7, 'date': 23, 'name': '海の日'},
{'from': 2021, 'to': 2021, 'month': 7, 'date': 22, 'name': '海の日'},
{'from': 2020, 'to': 2020, 'month': 7, 'date': 24, 'name': 'スポーツの日'},
{'from': 2021, 'to': 2021, 'month': 7, 'date': 23, 'name': 'スポーツの日'},
{'from': 2016, 'to': 2019, 'month': 8, 'date': 11, 'name': '山の日'},
{'from': 2020, 'to': 2020, 'month': 8, 'date': 10, 'name': '山の日'},
{'from': 2021, 'to': 2021, 'month': 8, 'date': 8, 'name': '山の日'},
{'from': 2022, 'to': null, 'month': 8, 'date': 11, 'name': '山の日'},
{'from': 1966, 'to': 2002, 'month': 9, 'date': 15, 'name': '敬老の日'},
{'from': 1966, 'to': 1999, 'month': 10, 'date': 10, 'name': '体育の日'},
{'from': 2019, 'to': 2019, 'month': 10, 'date': 22, 'name': '即位の礼正殿の儀'},
{'from': 1948, 'to': null, 'month': 11, 'date': 3, 'name': '文化の日'},
{'from': 1990, 'to': 1990, 'month': 11, 'date': 12, 'name': '即位の礼正殿の儀'},
{'from': 1948, 'to': null, 'month': 11, 'date': 23, 'name': '勤労感謝の日'},
{'from': 1989, 'to': 2018, 'month': 12, 'date': 23, 'name': '天皇誕生日'},
],
// ハッピーマンデー
// 'month': 1月は1
// turn: 月内で何回目の月曜日か
'happyMonday': [
{'from': 2000, 'to': null, 'month': 1, 'turn': 2, 'name': '成人の日'},
{'from': 2003, 'to': 2019, 'month': 7, 'turn': 3, 'name': '海の日'},
{'from': 2022, 'to': null, 'month': 7, 'turn': 3, 'name': '海の日'},
{'from': 2003, 'to': null, 'month': 9, 'turn': 3, 'name': '敬老の日'},
{'from': 2000, 'to': 2019, 'month': 10, 'turn': 2, 'name': '体育の日'},
{'from': 2022, 'to': null, 'month': 10, 'turn': 2, 'name': 'スポーツの日'},
],
// 春分の日 3月
// mod4: 配列のindexが西暦を4で割った余り
'shunbun': [
{
'from': 1924,
'to': 1959,
'mod4': [21, 21, 21, 21]
},
{
'from': 1960,
'to': 1991,
'mod4': [20, 21, 21, 21]
},
{
'from': 1992,
'to': 2023,
'mod4': [20, 20, 21, 21]
},
{
'from': 2024,
'to': 2055,
'mod4': [20, 20, 20, 21]
},
{
'from': 2056,
'to': 2091,
'mod4': [20, 20, 20, 20]
},
{
'from': 2092,
'to': 2099,
'mod4': [19, 20, 20, 20]
},
],
'shunbunName': '春分の日',
// 秋分の日 9月
// mod4: 配列のindexが西暦を4で割った余り
'shuubun': [
{
'from': 1948,
'to': 1979,
'mod4': [23, 23, 23, 24]
},
{
'from': 1980,
'to': 2011,
'mod4': [23, 23, 23, 23]
},
{
'from': 2012,
'to': 2043,
'mod4': [22, 23, 23, 23]
},
{
'from': 2044,
'to': 2075,
'mod4': [22, 22, 23, 23]
},
{
'from': 2076,
'to': 2099,
'mod4': [22, 22, 22, 23]
},
],
'shuubunName': '秋分の日',
};