Add Foundation Day holiday for Saudi Arabia (#388)
Foundation Day (Feb 22nd) is a public holiday in Saudi Arabia per: https://holidayapi.com/holidays/sa/foundation-day.
This commit is contained in:
parent
19a75f31c6
commit
aba5e6dba8
|
@ -138,11 +138,11 @@ export const HOLIDAY_REGIONS = [
|
|||
"hu",
|
||||
"id",
|
||||
"ie",
|
||||
"in",
|
||||
"in_gj",
|
||||
"in_mh",
|
||||
"in_rj",
|
||||
"in_tn",
|
||||
"in",
|
||||
"in_rj",
|
||||
"in_mh",
|
||||
"in_gj",
|
||||
"is",
|
||||
"it",
|
||||
"it_ve",
|
||||
|
@ -300,6 +300,7 @@ export const TIME_ZONE_TO_REGION = {
|
|||
"America/Caracas": "ve",
|
||||
"America/Chicago": "us",
|
||||
"America/Chihuahua": "mx",
|
||||
"America/Ciudad_Juarez": "mx",
|
||||
"America/Costa_Rica": "cr",
|
||||
"America/Creston": "ca",
|
||||
"America/Cuiaba": "br",
|
||||
|
@ -341,18 +342,15 @@ export const TIME_ZONE_TO_REGION = {
|
|||
"America/Moncton": "ca",
|
||||
"America/Monterrey": "mx",
|
||||
"America/New_York": "us",
|
||||
"America/Nipigon": "ca",
|
||||
"America/Nome": "us",
|
||||
"America/Noronha": "br",
|
||||
"America/North_Dakota/Beulah": "us",
|
||||
"America/North_Dakota/Center": "us",
|
||||
"America/North_Dakota/New_Salem": "us",
|
||||
"America/Ojinaga": "mx",
|
||||
"America/Pangnirtung": "ca",
|
||||
"America/Phoenix": "us",
|
||||
"America/Porto_Velho": "br",
|
||||
"America/Punta_Arenas": "cl",
|
||||
"America/Rainy_River": "ca",
|
||||
"America/Rankin_Inlet": "ca",
|
||||
"America/Recife": "br",
|
||||
"America/Regina": "ca",
|
||||
|
@ -365,7 +363,6 @@ export const TIME_ZONE_TO_REGION = {
|
|||
"America/St_Johns": "ca",
|
||||
"America/St_Thomas": "vi",
|
||||
"America/Swift_Current": "ca",
|
||||
"America/Thunder_Bay": "ca",
|
||||
"America/Tijuana": "mx",
|
||||
"America/Toronto": "ca",
|
||||
"America/Vancouver": "ca",
|
||||
|
@ -464,14 +461,12 @@ export const TIME_ZONE_TO_REGION = {
|
|||
"Europe/Stockholm": "se",
|
||||
"Europe/Tallinn": "ee",
|
||||
"Europe/Ulyanovsk": "ru",
|
||||
"Europe/Uzhgorod": "ua",
|
||||
"Europe/Vaduz": "li",
|
||||
"Europe/Vienna": "at",
|
||||
"Europe/Vilnius": "lt",
|
||||
"Europe/Volgograd": "ru",
|
||||
"Europe/Warsaw": "pl",
|
||||
"Europe/Zagreb": "hr",
|
||||
"Europe/Zaporozhye": "ua",
|
||||
"Europe/Zurich": "ch",
|
||||
"Pacific/Auckland": "nz",
|
||||
"Pacific/Chatham": "nz",
|
||||
|
|
|
@ -5,30 +5,23 @@ require "rails_helper"
|
|||
module DiscourseCalendar
|
||||
describe Holiday do
|
||||
describe ".find_holidays_for" do
|
||||
before do
|
||||
DisabledHoliday.create!(holiday_name: "New Year's Day", region_code: "sg")
|
||||
DisabledHoliday.create!(holiday_name: "Chinese New Year", region_code: "sg")
|
||||
end
|
||||
before { DisabledHoliday.create!(holiday_name: "Saudi National Day", region_code: "sa") }
|
||||
|
||||
let(:holidays) do
|
||||
Holiday.find_holidays_for(
|
||||
region_code: "sg",
|
||||
start_date: "2022-01-01",
|
||||
end_date: "2022-04-30",
|
||||
region_code: "sa",
|
||||
start_date: "2023-02-21",
|
||||
end_date: "2023-09-23",
|
||||
)
|
||||
end
|
||||
|
||||
it "returns a list of holidays indicating whether a holiday is disabled or not" do
|
||||
expect(holidays).to include(
|
||||
a_hash_including({ name: "New Year's Day", regions: [:sg], disabled: true }),
|
||||
a_hash_including({ name: "Saudi National Day", regions: [:sa], disabled: true }),
|
||||
)
|
||||
|
||||
expect(holidays).to include(
|
||||
a_hash_including({ name: "Chinese New Year", regions: [:sg], disabled: true }),
|
||||
)
|
||||
|
||||
expect(holidays).to include(
|
||||
a_hash_including({ name: "Good Friday", regions: [:sg], disabled: false }),
|
||||
a_hash_including({ name: "Foundation Day", regions: [:sa], disabled: false }),
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
---
|
||||
months:
|
||||
2:
|
||||
- name: Foundation Day
|
||||
regions: [sa]
|
||||
mday: 22
|
||||
5:
|
||||
- name: Festival of Breaking the Fast
|
||||
regions: [sa]
|
||||
|
|
|
@ -12,7 +12,8 @@ module Holidays
|
|||
|
||||
def self.holidays_by_month
|
||||
{
|
||||
5 => [{:mday => 2, :year_ranges => { :limited => [2022] },:name => "Festival of Breaking the Fast", :regions => [:sa]},
|
||||
2 => [{:mday => 22, :name => "Foundation Day", :regions => [:sa]}],
|
||||
5 => [{:mday => 2, :year_ranges => { :limited => [2022] },:name => "Festival of Breaking the Fast", :regions => [:sa]},
|
||||
{:mday => 3, :year_ranges => { :limited => [2022] },:name => "Second Day of the Festival of Breaking the Fast", :regions => [:sa]},
|
||||
{:mday => 4, :year_ranges => { :limited => [2022] },:name => "Third Day of the Festival of Breaking the Fast", :regions => [:sa]}],
|
||||
7 => [{:mday => 19, :year_ranges => { :limited => [2021] },:name => "Day of Arafah", :regions => [:sa]},
|
||||
|
|
|
@ -12,18 +12,18 @@ module Holidays
|
|||
|
||||
def self.holidays_by_month
|
||||
{
|
||||
1 => [{:mday => 1, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "New Year's Day", :regions => [:sg]}],
|
||||
2 => [{:mday => 1, :year_ranges => { :limited => [2022] },:name => "Chinese New Year", :regions => [:sg]},
|
||||
{:mday => 2, :year_ranges => { :limited => [2022] },:name => "Chinese New Year Holiday", :regions => [:sg]},
|
||||
{:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:sg]},
|
||||
1 => [{:mday => 1, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "New Year's Day", :regions => [:sg]},
|
||||
{:mday => 23, :year_ranges => { :limited => [2023] },:name => "First day of Chinese New Year (Observed)", :regions => [:sg]},
|
||||
{:mday => 24, :year_ranges => { :limited => [2023] },:name => "Second day of Chinese New Year", :regions => [:sg]}],
|
||||
2 => [{:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:sg]},
|
||||
{:mday => 15, :type => :informal, :name => "Total Defence Day", :regions => [:sg]}],
|
||||
4 => [{:mday => 15, :year_ranges => { :limited => [2022] },:name => "Good Friday", :regions => [:sg]}],
|
||||
5 => [{:mday => 1, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Labour Day", :regions => [:sg]},
|
||||
{:mday => 3, :year_ranges => { :limited => [2022] },:name => "Hari Raya Puasa", :regions => [:sg]},
|
||||
{:mday => 16, :year_ranges => { :limited => [2022] },:name => "Vesak Day Holiday", :regions => [:sg]}],
|
||||
7 => [{:mday => 11, :year_ranges => { :limited => [2022] },:name => "Hari Raya Haji Holiday", :regions => [:sg]}],
|
||||
4 => [{:mday => 7, :year_ranges => { :limited => [2023] },:name => "Good Friday", :regions => [:sg]},
|
||||
{:mday => 24, :year_ranges => { :limited => [2023] },:name => "Hari Raya Puasa (Observed)", :regions => [:sg]}],
|
||||
5 => [{:mday => 1, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Labour Day", :regions => [:sg]}],
|
||||
6 => [{:mday => 2, :year_ranges => { :limited => [2023] },:name => "Vesak Day", :regions => [:sg]},
|
||||
{:mday => 29, :year_ranges => { :limited => [2023] },:name => "Hari Raya Haji", :regions => [:sg]}],
|
||||
8 => [{:mday => 9, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "National Day", :regions => [:sg]}],
|
||||
10 => [{:mday => 24, :year_ranges => { :limited => [2022] },:name => "Deepavali", :regions => [:sg]}],
|
||||
11 => [{:mday => 13, :year_ranges => { :limited => [2023] },:name => "Deepavali (Observed)", :regions => [:sg]}],
|
||||
12 => [{:mday => 25, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:sg]}]
|
||||
}
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue