mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 17:53:55 +08:00
See https://www.myjoyonline.com/govt-declares-march-20-21-eid-ul-fitr-holidays-monday-march-23-additional-holiday
230 lines
4.8 KiB
YAML
Vendored
230 lines
4.8 KiB
YAML
Vendored
# Ghanaian holiday definitions for the Ruby Holiday gem.
|
|
#
|
|
# Added: 2022-08-17
|
|
# Sources:
|
|
# - https://www.mint.gov.gh/statutory-public-holidays/
|
|
# - https://www.officeholidays.com/countries/ghana/2022
|
|
# - https://www.bog.gov.gh/official-holidays/
|
|
---
|
|
months:
|
|
0:
|
|
- name: Good Friday
|
|
regions: [gh]
|
|
function: easter(year)
|
|
function_modifier: -2
|
|
- name: Easter Monday
|
|
regions: [gh]
|
|
function: easter(year)
|
|
function_modifier: 1
|
|
1:
|
|
- name: New Year's Day
|
|
regions: [gh]
|
|
mday: 1
|
|
observed: to_monday_if_weekend(date)
|
|
- name: Constitution Day
|
|
regions: [gh]
|
|
mday: 7
|
|
observed: to_monday_if_weekend(date)
|
|
3:
|
|
- name: Independence Day
|
|
regions: [gh]
|
|
mday: 6
|
|
observed: to_monday_if_weekend(date)
|
|
- name: Eid-ul-Fitr
|
|
regions: [gh]
|
|
mday: 20
|
|
observed: to_monday_if_weekend(date)
|
|
year_ranges:
|
|
limited: [2026]
|
|
- name: Shaqq Day
|
|
regions: [gh]
|
|
mday: 21
|
|
observed: to_monday_if_weekend(date)
|
|
year_ranges:
|
|
limited: [2026]
|
|
- name: Eid-ul-Fitr (Day 1)
|
|
regions: [gh]
|
|
mday: 31
|
|
year_ranges:
|
|
limited: [2025]
|
|
4:
|
|
- name: Eid-ul-Fitr
|
|
regions: [gh]
|
|
function: eid_ul_fitr(year)
|
|
observed: to_monday_if_weekend(date)
|
|
year_ranges:
|
|
until: 2024
|
|
- name: Eid-ul-Fitr (Day 2)
|
|
regions: [gh]
|
|
mday: 1
|
|
year_ranges:
|
|
limited: [2025]
|
|
5:
|
|
- name: May Day (Workers' Day)
|
|
regions: [gh]
|
|
mday: 1
|
|
observed: to_monday_if_weekend(date)
|
|
- name: African Union Day
|
|
regions: [gh]
|
|
mday: 25
|
|
type: informal
|
|
6:
|
|
- name: Eid-ul-Adha
|
|
regions: [gh]
|
|
function: eid_ul_adha(year)
|
|
observed: to_monday_if_weekend(date)
|
|
7:
|
|
- name: Republic Day
|
|
regions: [gh]
|
|
mday: 1
|
|
type: informal
|
|
8:
|
|
- name: Founders' Day
|
|
regions: [gh]
|
|
mday: 4
|
|
year_ranges:
|
|
from: 2019
|
|
observed: to_monday_if_weekend(date)
|
|
9:
|
|
- name: Kwame Nkrumah Memorial Day
|
|
regions: [gh]
|
|
mday: 21
|
|
observed: to_monday_if_weekend(date)
|
|
12:
|
|
- name: Farmer's Day
|
|
regions: [gh]
|
|
week: 1
|
|
wday: 5
|
|
observed: to_monday_if_weekend(date)
|
|
- name: Christmas Day
|
|
regions: [gh]
|
|
mday: 25
|
|
- name: Boxing Day
|
|
regions: [gh]
|
|
mday: 26
|
|
observed: to_weekday_if_boxing_weekend(date)
|
|
|
|
methods:
|
|
eid_ul_fitr:
|
|
arguments: year
|
|
ruby: |
|
|
eid_ul_fitr_dates = {
|
|
'2023' => Date.civil(2023, 4, 22),
|
|
'2024' => Date.civil(2024, 4, 11)
|
|
}
|
|
eid_ul_fitr_dates[year.to_s]
|
|
eid_ul_adha:
|
|
arguments: year
|
|
ruby: |
|
|
eid_ul_adha_dates = {
|
|
'2023' => Date.civil(2023, 6, 28),
|
|
'2024' => Date.civil(2024, 6, 16),
|
|
'2025' => Date.civil(2025, 6, 6)
|
|
}
|
|
eid_ul_adha_dates[year.to_s]
|
|
|
|
tests:
|
|
- given:
|
|
date: "2022-04-15"
|
|
regions: ["gh"]
|
|
expect:
|
|
name: "Good Friday"
|
|
- given:
|
|
date: "2022-04-18"
|
|
regions: ["gh"]
|
|
expect:
|
|
name: "Easter Monday"
|
|
- given:
|
|
date: "2022-01-03"
|
|
regions: ["gh"]
|
|
options: ["observed"]
|
|
expect:
|
|
name: "New Year's Day"
|
|
- given:
|
|
date: "2022-01-07"
|
|
regions: ["gh"]
|
|
expect:
|
|
name: "Constitution Day"
|
|
- given:
|
|
date: "2022-03-07"
|
|
regions: ["gh"]
|
|
options: ["observed"]
|
|
expect:
|
|
name: "Independence Day"
|
|
- given:
|
|
date: ["2026-03-20"]
|
|
regions: ["gh"]
|
|
expect:
|
|
name: "Eid-ul-Fitr"
|
|
- given:
|
|
date: ["2026-03-23"]
|
|
regions: ["gh"]
|
|
options: ["observed"]
|
|
expect:
|
|
name: "Shaqq Day"
|
|
- given:
|
|
date: ["2025-03-31"]
|
|
regions: ["gh"]
|
|
options: ["observed"]
|
|
expect:
|
|
name: "Eid-ul-Fitr (Day 1)"
|
|
- given:
|
|
date: ["2023-04-24", "2024-04-11"]
|
|
regions: ["gh"]
|
|
options: ["observed"]
|
|
expect:
|
|
name: "Eid-ul-Fitr"
|
|
- given:
|
|
date: ["2025-04-01"]
|
|
regions: ["gh"]
|
|
options: ["observed"]
|
|
expect:
|
|
name: "Eid-ul-Fitr (Day 2)"
|
|
- given:
|
|
date: "2022-05-01"
|
|
regions: ["gh"]
|
|
expect:
|
|
name: "May Day (Workers' Day)"
|
|
- given:
|
|
date: "2022-05-25"
|
|
regions: ["gh"]
|
|
options: ["informal"]
|
|
expect:
|
|
name: "African Union Day"
|
|
- given:
|
|
date: ["2023-06-28","2024-06-17", "2025-06-06"]
|
|
regions: ["gh"]
|
|
options: ["observed"]
|
|
expect:
|
|
name: "Eid-ul-Adha"
|
|
- given:
|
|
date: "2022-07-01"
|
|
regions: ["gh"]
|
|
options: ["informal"]
|
|
expect:
|
|
name: "Republic Day"
|
|
- given:
|
|
date: "2022-08-04"
|
|
regions: ["gh"]
|
|
expect:
|
|
name: "Founders' Day"
|
|
- given:
|
|
date: "2022-09-21"
|
|
regions: ["gh"]
|
|
expect:
|
|
name: "Kwame Nkrumah Memorial Day"
|
|
- given:
|
|
date: "2022-12-02"
|
|
regions: ["gh"]
|
|
expect:
|
|
name: "Farmer's Day"
|
|
- given:
|
|
date: "2022-12-25"
|
|
regions: ["gh"]
|
|
expect:
|
|
name: "Christmas Day"
|
|
- given:
|
|
date: "2022-12-26"
|
|
regions: ["gh"]
|
|
expect:
|
|
name: "Boxing Day"
|