From 2be934a08a15a8f95a6e4ff78adaf21ecfcb8159 Mon Sep 17 00:00:00 2001 From: Alex Ghiculescu Date: Thu, 8 Jun 2017 08:50:30 +1000 Subject: [PATCH 001/195] malaysia holiday updates --- my.yaml | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/my.yaml b/my.yaml index 9099f02..451f7ef 100644 --- a/my.yaml +++ b/my.yaml @@ -14,7 +14,6 @@ months: - name: New Year's Day regions: [my] mday: 1 - observed: to_weekday_if_weekend(date) 5: - name: Labour Day regions: [my] @@ -22,8 +21,11 @@ months: 6: - name: Agong's Birthday regions: [my] - mday: 4 - observed: to_weekday_if_weekend(date) + function: agong_birthday_june(year) + 7: + - name: Agong's Birthday + regions: [my] + function: agong_birthday_july(year) 8: - name: Independence Day regions: [my] @@ -33,19 +35,40 @@ months: - name: Malaysia Day regions: [my] mday: 16 - observed: to_weekday_if_weekend(date) 12: - name: Christmas Day regions: [my] mday: 25 observed: to_weekday_if_weekend(date) +methods: + agong_birthday_june: + arguments: year + source: | + if year <= 2016 + Date.new(year, 6, 4) + else + nil + end + agong_birthday_july: + arguments: year + source: | + if year >= 2017 + Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 7, :last, :saturday) + else + nil + end + tests: | {Date.civil(2016,1,1) => "New Year's Day", Date.civil(2016,5,1) => 'Labour Day', Date.civil(2016,6,4) => "Agong's Birthday", + Date.civil(2017,7,29) => "Agong's Birthday", Date.civil(2016,8,31) => 'Independence Day', Date.civil(2016,9,16) => 'Malaysia Day', Date.civil(2016,12,25) => 'Christmas Day'}.each do |date, name| assert_equal name, (Holidays.on(date, :my, :informal)[0] || {})[:name] end + + assert_nil Date.civil(2017, 9, 15).holidays(:my, :observed)[0] + assert_nil Date.civil(2017, 1, 2).holidays(:my, :observed)[0] From fe610f2b113f8469d2e028913ce09a2831918363 Mon Sep 17 00:00:00 2001 From: Adam Lyons Date: Mon, 7 Aug 2017 16:18:57 +1000 Subject: [PATCH 002/195] =?UTF-8?q?FIX:=20Agong=E2=80=99s=20birthday=20mov?= =?UTF-8?q?ed=20to=20September=20from=202017?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- my.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/my.yaml b/my.yaml index 451f7ef..bf97f06 100644 --- a/my.yaml +++ b/my.yaml @@ -22,16 +22,15 @@ months: - name: Agong's Birthday regions: [my] function: agong_birthday_june(year) - 7: - - name: Agong's Birthday - regions: [my] - function: agong_birthday_july(year) 8: - name: Independence Day regions: [my] mday: 31 observed: to_weekday_if_weekend(date) 9: + - name: Agong's Birthday + regions: [my] + function: agong_birthday_september(year) - name: Malaysia Day regions: [my] mday: 16 @@ -50,11 +49,11 @@ methods: else nil end - agong_birthday_july: + agong_birthday_september: arguments: year source: | if year >= 2017 - Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 7, :last, :saturday) + Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 9, :second, :saturday) else nil end @@ -63,7 +62,7 @@ tests: | {Date.civil(2016,1,1) => "New Year's Day", Date.civil(2016,5,1) => 'Labour Day', Date.civil(2016,6,4) => "Agong's Birthday", - Date.civil(2017,7,29) => "Agong's Birthday", + Date.civil(2017,9,09) => "Agong's Birthday", Date.civil(2016,8,31) => 'Independence Day', Date.civil(2016,9,16) => 'Malaysia Day', Date.civil(2016,12,25) => 'Christmas Day'}.each do |date, name| From b7c479d641b5365cf6197a1a180a7d69d64e968f Mon Sep 17 00:00:00 2001 From: Adam Lyons Date: Mon, 7 Aug 2017 16:25:18 +1000 Subject: [PATCH 003/195] FIX: bad date format --- my.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/my.yaml b/my.yaml index bf97f06..58e4607 100644 --- a/my.yaml +++ b/my.yaml @@ -62,7 +62,7 @@ tests: | {Date.civil(2016,1,1) => "New Year's Day", Date.civil(2016,5,1) => 'Labour Day', Date.civil(2016,6,4) => "Agong's Birthday", - Date.civil(2017,9,09) => "Agong's Birthday", + Date.civil(2017,9,9) => "Agong's Birthday", Date.civil(2016,8,31) => 'Independence Day', Date.civil(2016,9,16) => 'Malaysia Day', Date.civil(2016,12,25) => 'Christmas Day'}.each do |date, name| From a1ea623e6cd2f972e376ddd793091e1fb85b3ddf Mon Sep 17 00:00:00 2001 From: Alex Ghiculescu Date: Fri, 8 Sep 2017 10:06:45 +1000 Subject: [PATCH 004/195] Create pk.yaml --- pk.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 pk.yaml diff --git a/pk.yaml b/pk.yaml new file mode 100644 index 0000000..3db70e0 --- /dev/null +++ b/pk.yaml @@ -0,0 +1,31 @@ +# Pakistan holiday definitions for the Ruby Holiday gem. +# +# https://trello-attachments.s3.amazonaws.com/561af80c433ec5f6175b74ba/59b1156ea7e691f048c08b2b/d5c0513eca7d33141d76615b15d1d58b/Public_holidays_2017_(1).pdf +# Excluded holidays that are dependent on the moon appearing, and holidays that are only for Christians. +# +# https://en.wikipedia.org/wiki/Kashmir_Solidarity_Day +# https://en.wikipedia.org/wiki/Pakistan_Day +# https://www.timeanddate.com/holidays/pakistan/labour-day +# https://en.wikipedia.org/wiki/Independence_Day_(Pakistan) + +months: + 2: + - name: Kashmir Day + regions: [pk] + mday: 4 + 3: + - name: Pakistan Day + regions: [pk] + mday: 23 + 5: + - name: Labour Day + regions: [pk] + mday: 1 + 8: + - name: Independence Day + regions: [pk] + mday: 14 + 12: + - name: Quaid-i-Azam Day + regions: [pk] + mday: 25 From 67089f6e3b880fa1ee16015aa18d7f154d2343c9 Mon Sep 17 00:00:00 2001 From: Alex Ghiculescu Date: Fri, 8 Sep 2017 10:21:35 +1000 Subject: [PATCH 005/195] did merge badly --- my.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/my.yaml b/my.yaml index 4713646..d73a2dc 100644 --- a/my.yaml +++ b/my.yaml @@ -14,6 +14,7 @@ months: - name: New Year's Day regions: [my] mday: 1 + observed: to_weekday_if_weekend(date) 5: - name: Labour Day regions: [my] @@ -21,24 +22,24 @@ months: 6: - name: Agong's Birthday regions: [my] - function: agong_birthday_june(year) + mday: 4 + observed: to_weekday_if_weekend(date) 8: - name: Independence Day regions: [my] mday: 31 observed: to_weekday_if_weekend(date) 9: - - name: Agong's Birthday - regions: [my] - function: agong_birthday_september(year) - name: Malaysia Day regions: [my] mday: 16 + observed: to_weekday_if_weekend(date) 12: - name: Christmas Day regions: [my] mday: 25 observed: to_weekday_if_weekend(date) + tests: - given: date: '2016-01-01' From f61bb1a4a849917a5e21df62ce930bb859a51999 Mon Sep 17 00:00:00 2001 From: Alex Ghiculescu Date: Fri, 8 Sep 2017 10:30:51 +1000 Subject: [PATCH 006/195] Update index.yaml --- index.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/index.yaml b/index.yaml index afd0d67..87e5630 100644 --- a/index.yaml +++ b/index.yaml @@ -46,6 +46,7 @@ defs: NZ: ['nz.yaml'] PE: ['pe.yaml'] PH: ['ph.yaml'] + PK: ['pk.yaml'] PL: ['pl.yaml'] PT: ['pt.yaml'] RO: ['ro.yaml'] From 72ef894e93aac226acc56e9f8e3036e85c1b0933 Mon Sep 17 00:00:00 2001 From: alanhili Date: Fri, 8 Sep 2017 16:10:25 +1000 Subject: [PATCH 007/195] Create na --- na | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 na diff --git a/na b/na new file mode 100644 index 0000000..9758fd7 --- /dev/null +++ b/na @@ -0,0 +1,55 @@ +# Namibia holiday definitions for the Ruby Holiday gem. +# +# +# http://www.gov.na/holidays - shows list of days recognised as public holidays but dates haven't been updated since 2014 +# https://www.timeanddate.com/holidays/namibia/ - shows current dates +# Note that Ascension Day as that is Easter Sunday + 39 days which in 2017 landed on the same day as Africa Day - https://en.wikipedia.org/wiki/Public_holidays_in_Namibia +months: + 1: + name: New Years Days + regions: [na] + mday: 1 + 3: + name: Independence Day + regions: [na] + mday: 21 + 4: + name: Good Friday + regions: [na] + mday: 14 + 4: + name: Easter Monday + regions: [na] + mday: 17 + 5: + name: May Day + regions: [na] + mday: 1 + 5: + name: Cassinga Day + regions: [na] + mday: 4 + 5: + name: Ascendion Day + regions: [na] + mday: 25 + 5: + name: Africa Day + regions: [na] + mday: 25 + 8: + name: Heroes' Day + regions: [na] + mday: 26 + 12: + name: International Human Rights Day + regions: [na] + mday: 10 + 12: + name: Christmas Day + regions: [na] + mday: 25 + 12: + name: Day of Goodwill + regions: [na] + mday: 26 From 1b6b2bb7fc43c2195a6b418f9e73cfb28afc6b34 Mon Sep 17 00:00:00 2001 From: alanhili Date: Fri, 8 Sep 2017 16:17:46 +1000 Subject: [PATCH 008/195] Update index.yaml --- index.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/index.yaml b/index.yaml index 87e5630..2baa307 100644 --- a/index.yaml +++ b/index.yaml @@ -70,3 +70,4 @@ defs: SI: ['si.yaml'] SG: ['sg.yaml'] MY: ['my.yaml'] + NA: ['na.yaml'] From efa61e51041f4ba308ffd28324315ab299142c96 Mon Sep 17 00:00:00 2001 From: alanhili Date: Tue, 12 Sep 2017 12:35:43 +1000 Subject: [PATCH 009/195] Rename na to na.yaml --- na => na.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename na => na.yaml (100%) diff --git a/na b/na.yaml similarity index 100% rename from na rename to na.yaml From 681a72af8694c433451d0241c348a3859d2b10dc Mon Sep 17 00:00:00 2001 From: Alex Ghiculescu Date: Tue, 12 Sep 2017 14:23:17 +1000 Subject: [PATCH 010/195] use yaml array syntax --- na.yaml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/na.yaml b/na.yaml index 9758fd7..815380b 100644 --- a/na.yaml +++ b/na.yaml @@ -6,50 +6,44 @@ # Note that Ascension Day as that is Easter Sunday + 39 days which in 2017 landed on the same day as Africa Day - https://en.wikipedia.org/wiki/Public_holidays_in_Namibia months: 1: - name: New Years Days + - name: New Years Days regions: [na] mday: 1 3: - name: Independence Day + - name: Independence Day regions: [na] mday: 21 4: - name: Good Friday + - name: Good Friday regions: [na] mday: 14 - 4: - name: Easter Monday + - name: Easter Monday regions: [na] mday: 17 5: - name: May Day + - name: May Day regions: [na] mday: 1 - 5: - name: Cassinga Day + - name: Cassinga Day regions: [na] mday: 4 - 5: - name: Ascendion Day + - name: Ascendion Day regions: [na] mday: 25 - 5: - name: Africa Day + - name: Africa Day regions: [na] mday: 25 8: - name: Heroes' Day + - name: Heroes' Day regions: [na] mday: 26 12: - name: International Human Rights Day + - name: International Human Rights Day regions: [na] mday: 10 - 12: - name: Christmas Day + - name: Christmas Day regions: [na] mday: 25 - 12: - name: Day of Goodwill + - name: Day of Goodwill regions: [na] mday: 26 From 19f89a95c6c8d6a925a3674ceecdaaa2b0e4e852 Mon Sep 17 00:00:00 2001 From: adamlyons2 Date: Tue, 21 Nov 2017 11:00:29 +1000 Subject: [PATCH 011/195] ADD: public holiday definitions for mozambique --- index.yaml | 1 + mz.yaml | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 mz.yaml diff --git a/index.yaml b/index.yaml index c4d558d..c9484da 100644 --- a/index.yaml +++ b/index.yaml @@ -34,6 +34,7 @@ defs: LT: ['lt.yaml'] MA: ['ma.yaml'] MX: ['mx.yaml', 'north_america_informal.yaml'] + MZ: ['mz.yaml'] NERC: ['nerc.yaml'] NL: ['nl.yaml'] LU: ['lu.yaml'] diff --git a/mz.yaml b/mz.yaml new file mode 100644 index 0000000..3222814 --- /dev/null +++ b/mz.yaml @@ -0,0 +1,59 @@ +# Mozambique holiday definitions for the Holidays gem! + +# Source: +# http://www.officeholidays.com/countries/mozambique/2017.php + +months: + 1: + - name: New Year's Day + regions: [mz] + mday: 1 + observed: to_monday_if_weekend(date) + 2: + - name: Heroes' Day + regions: [mz] + mday: 3 + 4: + - name: Women's Day + regions: [mz] + mday: 7 + 5: + - name: Worker's Day + regions: [mz] + mday: 1 + 6: + - name: Independence Day + regions: [mz] + mday: 25 + 9: + - name: Victory Day + regions: [mz] + mday: 7 + - name: Revolution Day + regions: [mz] + mday: 25 + 10: + - name: Day of Peace and Reconciliation + regions: [mz] + mday: 4 + 12: + - name: Family Day + regions: [mz] + mday: 25 + +tests: | + {Date.civil(2017,1,1) => "New Year's Day", + Date.civil(2017,2,1) => "New Year's Day", + Date.civil(2017,2,3) => "Heroes' Day", + Date.civil(2017,4,7) => "Women's Day", + Date.civil(2017,5,1) => "Worker's Day", + Date.civil(2017,6,25) => "Independence Day", + Date.civil(2017,9,7) => "Victory Day", + Date.civil(2017,9,25) => "Revolution Day", + Date.civil(2017,10,4) => "Day of Peace and Reconciliation", + Date.civil(2017,12,25) => 'Family Day'}.each do |date, name| + assert_equal name, (Holidays.on(date, :my, :informal)[0] || {})[:name] + end + + assert_nil Date.civil(2017, 9, 15).holidays(:my, :observed)[0] + assert_nil Date.civil(2017, 1, 2).holidays(:my, :observed)[0] \ No newline at end of file From 4ed81c5da86f3edba590efaba2d34d5418f88b36 Mon Sep 17 00:00:00 2001 From: adamlyons2 Date: Tue, 21 Nov 2017 11:01:48 +1000 Subject: [PATCH 012/195] FIX: malaysia day isn't observed - just applies on the day --- my.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/my.yaml b/my.yaml index d73a2dc..8070828 100644 --- a/my.yaml +++ b/my.yaml @@ -33,7 +33,6 @@ months: - name: Malaysia Day regions: [my] mday: 16 - observed: to_weekday_if_weekend(date) 12: - name: Christmas Day regions: [my] From 5af919aeeeb90541f801fc36f31dae11392776d9 Mon Sep 17 00:00:00 2001 From: adamlyons2 Date: Tue, 21 Nov 2017 11:09:26 +1000 Subject: [PATCH 013/195] FIX: write tests correctly --- mz.yaml | 77 +++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 16 deletions(-) diff --git a/mz.yaml b/mz.yaml index 3222814..4c13d38 100644 --- a/mz.yaml +++ b/mz.yaml @@ -41,19 +41,64 @@ months: regions: [mz] mday: 25 -tests: | - {Date.civil(2017,1,1) => "New Year's Day", - Date.civil(2017,2,1) => "New Year's Day", - Date.civil(2017,2,3) => "Heroes' Day", - Date.civil(2017,4,7) => "Women's Day", - Date.civil(2017,5,1) => "Worker's Day", - Date.civil(2017,6,25) => "Independence Day", - Date.civil(2017,9,7) => "Victory Day", - Date.civil(2017,9,25) => "Revolution Day", - Date.civil(2017,10,4) => "Day of Peace and Reconciliation", - Date.civil(2017,12,25) => 'Family Day'}.each do |date, name| - assert_equal name, (Holidays.on(date, :my, :informal)[0] || {})[:name] - end - - assert_nil Date.civil(2017, 9, 15).holidays(:my, :observed)[0] - assert_nil Date.civil(2017, 1, 2).holidays(:my, :observed)[0] \ No newline at end of file +tests: + - given: + date: '2017-01-01' + regions: ["mz"] + options: ["informal"] + expect: + name: "New Year's Day" + - given: + date: '2017-01-02' + regions: ["mz"] + options: ["informal"] + expect: + name: "New Year's Day" + - given: + date: '2017-02-03' + regions: ["mz"] + options: ["informal"] + expect: + name: "Heroes' Day" + - given: + date: '2017-04-07' + regions: ["mz"] + options: ["informal"] + expect: + name: "Women's Day" + - given: + date: '2017-05-01' + regions: ["mz"] + options: ["informal"] + expect: + name: "Worker's Day" + - given: + date: '2017-06-25' + regions: ["mz"] + options: ["informal"] + expect: + name: "Independence Day" + - given: + date: '2017-09-07' + regions: ["mz"] + options: ["informal"] + expect: + name: "Victory Day" + - given: + date: '2017-09-25' + regions: ["mz"] + options: ["informal"] + expect: + name: "Revolution Day" + - given: + date: '2017-10-04' + regions: ["mz"] + options: ["informal"] + expect: + name: "Day of Peace and Reconciliation" + - given: + date: '2017-12-25' + regions: ["mz"] + options: ["informal"] + expect: + name: "Family Day" From 60c35cc5b71bb37f03776e17d4e768285f30e7b5 Mon Sep 17 00:00:00 2001 From: marvinjason Date: Fri, 23 Mar 2018 09:15:02 +0800 Subject: [PATCH 014/195] Replace 'Family & Community Day' with 'ACT Reconciliation Day' --- au.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/au.yaml b/au.yaml index f020d74..d17eaaa 100644 --- a/au.yaml +++ b/au.yaml @@ -89,6 +89,11 @@ months: - name: May Public Holiday regions: [au_sa] function: may_pub_hol_sa(year) + - name: ACT Reconciliation Day + regions: [au_act] + mday: 28 + year_ranges: + - after: 2018 6: - name: Foundation Day regions: [au_wa] @@ -124,6 +129,8 @@ months: regions: [au_act] week: -1 wday: 1 + year_ranges: + - before: 2017 10: - name: Friday before the AFL Grand Final regions: [au_vic] @@ -304,6 +311,11 @@ tests: regions: ["au_act"] expect: name: 'Family & Community Day' + - given: + date: ['2018-05-28'] + regions: ["au_act"] + expect: + name: 'ACT Reconciliation Day' - given: date: '2014-01-26' regions: ["au_qld"] From 28f02545b7ae1846c9453a2d79aee29bdd052ffa Mon Sep 17 00:00:00 2001 From: marvinjason Date: Fri, 23 Mar 2018 13:45:19 +0800 Subject: [PATCH 015/195] Update Pakistan holidays --- pk.yaml | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/pk.yaml b/pk.yaml index 3db70e0..63bb4fd 100644 --- a/pk.yaml +++ b/pk.yaml @@ -12,7 +12,7 @@ months: 2: - name: Kashmir Day regions: [pk] - mday: 4 + mday: 5 3: - name: Pakistan Day regions: [pk] @@ -29,3 +29,79 @@ months: - name: Quaid-i-Azam Day regions: [pk] mday: 25 +tests: + - given: + date: '2017-02-05' + regions: ["pk"] + expect: + name: 'Kashmir Day' + - given: + date: '2018-02-05' + regions: ["pk"] + expect: + name: 'Kashmir Day' + - given: + date: '2019-02-05' + regions: ["pk"] + expect: + name: 'Kashmir Day' + - given: + date: '2017-03-23' + regions: ["pk"] + expect: + name: 'Pakistan Day' + - given: + date: '2018-03-23' + regions: ["pk"] + expect: + name: 'Pakistan Day' + - given: + date: '2019-03-23' + regions: ["pk"] + expect: + name: 'Pakistan Day' + - given: + date: '2017-05-01' + regions: ["pk"] + expect: + name: 'Labour Day' + - given: + date: '2018-05-01' + regions: ["pk"] + expect: + name: 'Labour Day' + - given: + date: '2019-05-01' + regions: ["pk"] + expect: + name: 'Labour Day' + - given: + date: '2017-08-14' + regions: ["pk"] + expect: + name: 'Independence Day' + - given: + date: '2018-08-14' + regions: ["pk"] + expect: + name: 'Independence Day' + - given: + date: '2019-08-14' + regions: ["pk"] + expect: + name: 'Independence Day' + - given: + date: '2017-12-25' + regions: ["pk"] + expect: + name: 'Quaid-i-Azam Day' + - given: + date: '2018-12-25' + regions: ["pk"] + expect: + name: 'Quaid-i-Azam Day' + - given: + date: '2019-12-25' + regions: ["pk"] + expect: + name: 'Quaid-i-Azam Day' \ No newline at end of file From aa78621a7388f84cba39356142daf4a4ae922cac Mon Sep 17 00:00:00 2001 From: David Buchan-Swanson Date: Thu, 5 Apr 2018 15:34:53 +1000 Subject: [PATCH 016/195] update namibian public holidays --- na.yaml | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/na.yaml b/na.yaml index 815380b..a8d84e4 100644 --- a/na.yaml +++ b/na.yaml @@ -2,9 +2,28 @@ # # # http://www.gov.na/holidays - shows list of days recognised as public holidays but dates haven't been updated since 2014 +# can also look at https://publicholidays.africa/namibia/2018-dates/ +# future dates at https://publicholidays.africa/namibia/2019-dates/ # https://www.timeanddate.com/holidays/namibia/ - shows current dates # Note that Ascension Day as that is Easter Sunday + 39 days which in 2017 landed on the same day as Africa Day - https://en.wikipedia.org/wiki/Public_holidays_in_Namibia months: + 0: + - name: Good Friday + regions: [na] + # calculates Easter Sunday + function: easter(year) + # goes 2 days back from Easter Sunday + function_modifer: -2 + - name: Easter Monday + regions: [na] + # calculates Easter Sunday + function: easter(year) + # goes 1 day forward from Easter Sunday + function_modifer: 1 + - name: Ascension Day + regions: [na] + function: easter(year) + function_modifer: 39 1: - name: New Years Days regions: [na] @@ -13,23 +32,13 @@ months: - name: Independence Day regions: [na] mday: 21 - 4: - - name: Good Friday - regions: [na] - mday: 14 - - name: Easter Monday - regions: [na] - mday: 17 5: - - name: May Day + - name: Worker's Day regions: [na] mday: 1 - name: Cassinga Day regions: [na] mday: 4 - - name: Ascendion Day - regions: [na] - mday: 25 - name: Africa Day regions: [na] mday: 25 @@ -37,6 +46,7 @@ months: - name: Heroes' Day regions: [na] mday: 26 + observed: to_monday_if_weekend(date) 12: - name: International Human Rights Day regions: [na] @@ -44,6 +54,6 @@ months: - name: Christmas Day regions: [na] mday: 25 - - name: Day of Goodwill + - name: Family Day regions: [na] mday: 26 From ff7df70e00007763c0cc7f7692119345231a68ea Mon Sep 17 00:00:00 2001 From: David Buchan-Swanson Date: Thu, 5 Apr 2018 15:52:44 +1000 Subject: [PATCH 017/195] update test for namibia --- na.yaml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/na.yaml b/na.yaml index a8d84e4..76ba674 100644 --- a/na.yaml +++ b/na.yaml @@ -13,17 +13,17 @@ months: # calculates Easter Sunday function: easter(year) # goes 2 days back from Easter Sunday - function_modifer: -2 + function_modifier: -2 - name: Easter Monday regions: [na] # calculates Easter Sunday function: easter(year) # goes 1 day forward from Easter Sunday - function_modifer: 1 + function_modifier: 1 - name: Ascension Day regions: [na] function: easter(year) - function_modifer: 39 + function_modifier: 39 1: - name: New Years Days regions: [na] @@ -57,3 +57,25 @@ months: - name: Family Day regions: [na] mday: 26 + +tests: + - given: + date: '2018-1-1' + regions: [na] + expect: + name: New Years Days + - given: + date: '2018-03-30' + regions: [na] + expect: + name: Good Friday + - given: + date: '2018-04-02' + regions: [na] + expect: + name: Easter Monday + - given: + date: '2018-05-10' + regions: [na] + expect: + name: Ascension Day From 0d0786dcba10ad6aef835a94f2fe38430db96506 Mon Sep 17 00:00:00 2001 From: David Buchan-Swanson Date: Thu, 5 Apr 2018 15:57:59 +1000 Subject: [PATCH 018/195] confirm the holidays work for 2019, too --- na.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/na.yaml b/na.yaml index 76ba674..2a1250d 100644 --- a/na.yaml +++ b/na.yaml @@ -79,3 +79,23 @@ tests: regions: [na] expect: name: Ascension Day + - given: + date: '2018-08-27' + regions: [na] + expect: + name: Heroes' Day + - given: + date: '2019-04-22' + regions: [na] + expect: + name: Easter Monday + - given: + date: '2019-05-30' + regions: [na] + expect: + name: Ascension Day + - given: + date: '2019-08-26' + regions: [na] + expect: + name: Heroes' Day From 784045f2eb084269d30f22f8fc1a7e133123ccae Mon Sep 17 00:00:00 2001 From: Philip Fraser Date: Fri, 20 Apr 2018 08:42:54 +1000 Subject: [PATCH 019/195] Removed easter sunday from GB yaml --- gb.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/gb.yaml b/gb.yaml index d3415a2..3828de7 100644 --- a/gb.yaml +++ b/gb.yaml @@ -18,9 +18,6 @@ months: regions: [gb] function: easter(year) function_modifier: -2 - - name: Easter Sunday - regions: [gb] - function: easter(year) - name: Easter Monday regions: [gb_eng, gb_wls, gb_eaw, gb_nir] function: easter(year) @@ -104,12 +101,6 @@ tests: options: ["informal"] expect: name: "Good Friday" - - given: - date: '2008-03-23' - regions: ["gb"] - options: ["informal"] - expect: - name: "Easter Sunday" - given: date: '2008-05-05' regions: ["gb"] From 7c4fbacdde6513092574d06efa89a3c0fab708a0 Mon Sep 17 00:00:00 2001 From: Alex Ghiculescu Date: Thu, 23 Aug 2018 09:49:26 -0500 Subject: [PATCH 020/195] remove easter sunday see http://www.emploi.belgique.be/detailA_Z.aspx?id=926 / #4231 --- be_fr.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/be_fr.yaml b/be_fr.yaml index 315c5e4..377e8bd 100644 --- a/be_fr.yaml +++ b/be_fr.yaml @@ -17,10 +17,6 @@ months: regions: ['be_fr'] function: easter(year) function_modifier: 39 - - name: Pentecôte - regions: ['be_fr'] - function: easter(year) - function_modifier: 49 - name: Lundi de Pentecôte regions: ['be_fr'] function: easter(year) From b381666baf964cd0a8185cc9d938d5bc1f8085ae Mon Sep 17 00:00:00 2001 From: Alex Ghiculescu Date: Thu, 23 Aug 2018 09:49:41 -0500 Subject: [PATCH 021/195] remove easter sunday see http://www.emploi.belgique.be/detailA_Z.aspx?id=926 / #4231 --- be_nl.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/be_nl.yaml b/be_nl.yaml index 4586195..404eba6 100644 --- a/be_nl.yaml +++ b/be_nl.yaml @@ -17,10 +17,6 @@ months: regions: [be_nl] function: easter(year) function_modifier: 39 - - name: Pinksteren - regions: [be_nl] - function: easter(year) - function_modifier: 49 - name: Pinkstermaandag regions: [be_nl] function: easter(year) From 78a1d2c82e255e2ba2e9606e7f17a69a7aa0e107 Mon Sep 17 00:00:00 2001 From: Alex Ghiculescu Date: Thu, 23 Aug 2018 09:54:55 -0500 Subject: [PATCH 022/195] update tests --- be_fr.yaml | 6 ------ be_nl.yaml | 6 ------ 2 files changed, 12 deletions(-) diff --git a/be_fr.yaml b/be_fr.yaml index 377e8bd..4fec351 100644 --- a/be_fr.yaml +++ b/be_fr.yaml @@ -80,12 +80,6 @@ tests: options: ["informal"] expect: name: 'Ascension' - - given: - date: '2007-05-27' - regions: ['be_fr'] - options: ["informal"] - expect: - name: 'Pentecôte' - given: date: '2007-05-28' regions: ['be_fr'] diff --git a/be_nl.yaml b/be_nl.yaml index 404eba6..667cb9f 100644 --- a/be_nl.yaml +++ b/be_nl.yaml @@ -80,12 +80,6 @@ tests: options: ["informal"] expect: name: 'O.H. Hemelvaart' - - given: - date: '2007-05-27' - regions: ["be_nl"] - options: ["informal"] - expect: - name: 'Pinksteren' - given: date: '2007-05-28' regions: ["be_nl"] From bf602e4db238c3ef6d48e7cafe29ab103eb7d047 Mon Sep 17 00:00:00 2001 From: Alex Ghiculescu Date: Thu, 23 Aug 2018 10:14:16 -0500 Subject: [PATCH 023/195] fix incorrect tests --- mz.yaml | 13 ++----------- na.yaml | 3 ++- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/mz.yaml b/mz.yaml index 4c13d38..e829828 100644 --- a/mz.yaml +++ b/mz.yaml @@ -41,64 +41,55 @@ months: regions: [mz] mday: 25 -tests: +tests: - given: date: '2017-01-01' regions: ["mz"] - options: ["informal"] expect: name: "New Year's Day" - given: date: '2017-01-02' regions: ["mz"] - options: ["informal"] + options: ["observed"] expect: name: "New Year's Day" - given: date: '2017-02-03' regions: ["mz"] - options: ["informal"] expect: name: "Heroes' Day" - given: date: '2017-04-07' regions: ["mz"] - options: ["informal"] expect: name: "Women's Day" - given: date: '2017-05-01' regions: ["mz"] - options: ["informal"] expect: name: "Worker's Day" - given: date: '2017-06-25' regions: ["mz"] - options: ["informal"] expect: name: "Independence Day" - given: date: '2017-09-07' regions: ["mz"] - options: ["informal"] expect: name: "Victory Day" - given: date: '2017-09-25' regions: ["mz"] - options: ["informal"] expect: name: "Revolution Day" - given: date: '2017-10-04' regions: ["mz"] - options: ["informal"] expect: name: "Day of Peace and Reconciliation" - given: date: '2017-12-25' regions: ["mz"] - options: ["informal"] expect: name: "Family Day" diff --git a/na.yaml b/na.yaml index 2a1250d..04fe8bf 100644 --- a/na.yaml +++ b/na.yaml @@ -1,6 +1,6 @@ # Namibia holiday definitions for the Ruby Holiday gem. # -# +# # http://www.gov.na/holidays - shows list of days recognised as public holidays but dates haven't been updated since 2014 # can also look at https://publicholidays.africa/namibia/2018-dates/ # future dates at https://publicholidays.africa/namibia/2019-dates/ @@ -82,6 +82,7 @@ tests: - given: date: '2018-08-27' regions: [na] + options: ["observed"] expect: name: Heroes' Day - given: From 9df8862a1ce30fd44268d36dc028d76f0207a524 Mon Sep 17 00:00:00 2001 From: arielleleano <39390684+arielleleano@users.noreply.github.com> Date: Wed, 19 Sep 2018 08:30:13 +0800 Subject: [PATCH 024/195] Add AFL holiday --- au.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/au.yaml b/au.yaml index d17eaaa..48a9f2b 100644 --- a/au.yaml +++ b/au.yaml @@ -5,6 +5,7 @@ # - http://www.docep.wa.gov.au/lr/LabourRelations/Content/Wages%20and%20Conditions/Public%20Holidays/Public_Holidays.html # - http://www.wst.tas.gov.au/employment_info/public_holidays # - https://www.fairwork.gov.au/leave/public-holidays/list-of-public-holidays +# - http://www.business.vic.gov.au/victorian-public-holidays-and-daylight-saving/victorian-public-holidays --- months: 0: @@ -28,6 +29,9 @@ months: regions: [au] function: easter(year) function_modifier: 1 + - name: Friday before the AFL Grand Final + regions: [au_vic] + function: afl_grand_final(year) 1: - name: New Year's Day regions: [au, au_nsw, au_vic, au_act, au_sa, au_wa, au_nt, au_qld] @@ -132,9 +136,6 @@ months: year_ranges: - before: 2017 10: - - name: Friday before the AFL Grand Final - regions: [au_vic] - function: afl_grand_final(year) - name: Labour Day regions: [au_act, au_nsw, au_sa] week: 1 @@ -193,6 +194,8 @@ methods: Date.civil(2016, 9, 30) when 2017 Date.civil(2017, 9, 29) + when 2018 + Date.civil(2018, 9, 28) end qld_queens_bday_october: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates @@ -468,6 +471,11 @@ tests: regions: ["au_vic"] expect: name: 'Friday before the AFL Grand Final' + - given: + date: '2018-09-28' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' - given: date: '2005-05-16' regions: ["au_sa"] From cb8c69eef4d638223bb29fc18b9f502ac65c9850 Mon Sep 17 00:00:00 2001 From: Philip Fraser Date: Wed, 17 Oct 2018 11:21:48 +1000 Subject: [PATCH 025/195] created thai holidays --- th.yaml | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 th.yaml diff --git a/th.yaml b/th.yaml new file mode 100644 index 0000000..b0bd626 --- /dev/null +++ b/th.yaml @@ -0,0 +1,144 @@ +# Thai holiday definitions for the Ruby Holiday gem. +# +# Updated: 2018-10-17. +# Sources: +# - Photo in this trello card https://trello.com/c/zSDdA4Zy/39-add-public-holidays +--- +months: + 1: + - name: New Year's Day + regions: [th] + mday: 1 + observed: to_monday_if_weekend(date) + 3: + - name: Makha Bucha Day + regions: [th] + mday: 1 + 4: + - name: Chakri Memorial Day + regions: [th] + wday: 6 + - name: Songkran Day + regions: [th] + mday: 13 + - name: Songkran Festival + regions: [th] + wday: 16 + 5: + - name: National Labour Day + regions: [th] + mday: 1 + - name: Wisakha Bucha Day + regions: [th] + mday: 29 + 7: + - name: Asarnha Bucha Day + regions: [th] + wday: 27 + - name: H.M. King Maha Vajiralongkorn Bodindradebayavarangkun's Birthday + regions: [th] + wday: 28 + observed: to_monday_if_weekend(date) + 8: + - name: H.M. Queen Sirikit's Birthday + regions: [th] + mday: 12 + observed: to_monday_if_weekend(date) + 10: + - name: Commemoration of the Passing King Bhumibol + regions: [th] + mday: 13 + observed: to_monday_if_weekend(date) + - name: Chulalongkorn Day + regions: [th] + mday: 23 + 12: + - name: Late King Bhumibol Adulyadej's Birthday, National Day and National Father's Day + regions: [th] + mday: 5 + - name: Constitution Day + regions: [th] + mday: 10 + - name: Year's End Day + regions: [th] + mday: 31 + +tests: + - given: + date: '2008-01-01' + regions: ["th"] + expect: + name: "New Year's Day" + - given: + date: '2008-03-01' + regions: ["th"] + expect: + name: "Makha Bucha Day" + - given: + date: '2008-04-06' + regions: ["th"] + expect: + name: "Chakri Memorial Day" + - given: + date: '2008-04-13' + regions: ["th"] + expect: + name: "Songkran Day" + - given: + date: '2008-04-16' + regions: ["th"] + expect: + name: "Songkran Festival" + - given: + date: '2008-05-01' + regions: ["th"] + expect: + name: "National Labour Day" + - given: + date: '2008-05-29' + regions: ["th"] + expect: + name: "Wisakha Bucha Day" + - given: + date: '2008-07-27' + regions: ["th"] + expect: + name: "Asarnha Bucha Day" + - given: + date: '2008-07-28' + regions: ["th"] + options: ["observed"] + expect: + name: "H.M. King Maha Vajiralongkorn Bodindradebayavarangkun's Birthday" + - given: + date: '2008-08-12' + regions: ["th"] + options: ["observed"] + expect: + name: "H.M. Queen Sirikit's Birthday" + - given: + date: '2008-10-13' + regions: ["th"] + options: ["observed"] + expect: + name: "Commemoration of the Passing King Bhumibol" + - given: + date: '2008-10-23' + regions: ["th"] + expect: + name: "Chulalongkorn Day" + - given: + date: '2008-12-05' + regions: ["th"] + expect: + name: "Late King Bhumibol Adulyadej's Birthday, National Day and National Father's Day" + - given: + date: '2008-12-10' + regions: ["th"] + expect: + name: "Constitution Day" + - given: + date: '2008-12-31' + regions: ["th"] + expect: + name: "Year's End Day" From 94a0569a0fbb990910b40879e307c674bb5ab4a5 Mon Sep 17 00:00:00 2001 From: Philip Fraser Date: Wed, 17 Oct 2018 12:25:36 +1000 Subject: [PATCH 026/195] thai definitions --- index.yaml | 1 + th.yaml | 38 +++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/index.yaml b/index.yaml index 489c9aa..4ded948 100644 --- a/index.yaml +++ b/index.yaml @@ -56,6 +56,7 @@ defs: RS_LA: ['rs_la.yaml'] RU: ['ru.yaml'] SE: ['se.yaml'] + TH: ['th.yaml'] TN: ['tn.yaml'] TR: ['tr.yaml'] US: ['us.yaml', 'north_america_informal.yaml'] diff --git a/th.yaml b/th.yaml index b0bd626..6143f08 100644 --- a/th.yaml +++ b/th.yaml @@ -17,13 +17,13 @@ months: 4: - name: Chakri Memorial Day regions: [th] - wday: 6 + mday: 6 - name: Songkran Day regions: [th] mday: 13 - name: Songkran Festival regions: [th] - wday: 16 + mday: 16 5: - name: National Labour Day regions: [th] @@ -34,10 +34,10 @@ months: 7: - name: Asarnha Bucha Day regions: [th] - wday: 27 + mday: 27 - name: H.M. King Maha Vajiralongkorn Bodindradebayavarangkun's Birthday regions: [th] - wday: 28 + mday: 28 observed: to_monday_if_weekend(date) 8: - name: H.M. Queen Sirikit's Birthday @@ -65,80 +65,80 @@ months: tests: - given: - date: '2008-01-01' + date: '2016-01-01' regions: ["th"] expect: name: "New Year's Day" - given: - date: '2008-03-01' + date: '2016-03-01' regions: ["th"] expect: name: "Makha Bucha Day" - given: - date: '2008-04-06' + date: '2016-04-06' regions: ["th"] expect: name: "Chakri Memorial Day" - given: - date: '2008-04-13' + date: '2016-04-13' regions: ["th"] expect: name: "Songkran Day" - given: - date: '2008-04-16' + date: '2016-04-16' regions: ["th"] expect: name: "Songkran Festival" - given: - date: '2008-05-01' + date: '2016-05-01' regions: ["th"] expect: name: "National Labour Day" - given: - date: '2008-05-29' + date: '2016-05-29' regions: ["th"] expect: name: "Wisakha Bucha Day" - given: - date: '2008-07-27' + date: '2016-07-27' regions: ["th"] expect: name: "Asarnha Bucha Day" - given: - date: '2008-07-28' + date: '2016-07-28' regions: ["th"] options: ["observed"] expect: name: "H.M. King Maha Vajiralongkorn Bodindradebayavarangkun's Birthday" - given: - date: '2008-08-12' + date: '2016-08-12' regions: ["th"] options: ["observed"] expect: name: "H.M. Queen Sirikit's Birthday" - given: - date: '2008-10-13' + date: '2016-10-13' regions: ["th"] options: ["observed"] expect: name: "Commemoration of the Passing King Bhumibol" - given: - date: '2008-10-23' + date: '2016-10-23' regions: ["th"] expect: name: "Chulalongkorn Day" - given: - date: '2008-12-05' + date: '2016-12-05' regions: ["th"] expect: name: "Late King Bhumibol Adulyadej's Birthday, National Day and National Father's Day" - given: - date: '2008-12-10' + date: '2016-12-10' regions: ["th"] expect: name: "Constitution Day" - given: - date: '2008-12-31' + date: '2016-12-31' regions: ["th"] expect: name: "Year's End Day" From c8c4cadc792943ede4333da3fb1bd79c988642ba Mon Sep 17 00:00:00 2001 From: marvinjason Date: Thu, 1 Nov 2018 00:23:38 +0800 Subject: [PATCH 027/195] Add Liberia public holidays --- index.yaml | 1 + lr.yaml | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 lr.yaml diff --git a/index.yaml b/index.yaml index 4ded948..75b507c 100644 --- a/index.yaml +++ b/index.yaml @@ -34,6 +34,7 @@ defs: IT: ['it.yaml'] KR: ['kr.yaml'] LI: ['li.yaml'] + LR: ['lr.yaml'] LT: ['lt.yaml'] MA: ['ma.yaml'] MT_MT: ['mt_mt.yaml'] diff --git a/lr.yaml b/lr.yaml new file mode 100644 index 0000000..007a399 --- /dev/null +++ b/lr.yaml @@ -0,0 +1,73 @@ +# Liberian holiday definitions for the Ruby Holiday gem. +# +# Updated: 2018-10-31. +# +# Sources: +# - https://www.officeholidays.com/countries/liberia/2018 +# - https://en.wikipedia.org/wiki/Public_holidays_in_Liberia +--- +months: + 1: + - name: New Year's Day + regions: [lr] + mday: 1 + 2: + - name: Armed Forces Day + regions: [lr] + mday: 11 + 3: + - name: J.J. Roberts' Birthday + regions: [lr] + mday: 15 + - name: Decoration Day + regions: [lr] + week: 2 + wday: 3 + 4: + - name: National Redemption Day + regions: [lr] + mday: 12 + - name: Fast and Prayer Day + regions: [lr] + week: 2 + wday: 5 + 5: + - name: National Unification Day + regions: [lr] + mday: 14 + 7: + - name: Independence Day + regions: [lr] + mday: 26 + 8: + - name: Flag Day + regions: [lr] + mday: 24 + 11: + - name: William Tubman's Birthday + regions: [lr] + mday: 29 + - name: National Thanksgiving Day + regions: [lr] + week: 1 + wday: 4 + 12: + - name: Christmas Day + regions: [lr] + mday: 25 +tests: + - given: + date: ['2018-03-14', '2019-03-13'] + regions: ['lr'] + expect: + name: 'Decoration Day' + - given: + date: ['2018-04-13', '2020-04-10'] + regions: ['lr'] + expect: + name: 'Fast and Prayer Day' + - given: + date: ['2018-11-01', '2019-11-07'] + regions: ['lr'] + expect: + name: 'National Thanksgiving Day' From eb29dc625e96d441e1439146f153800b741e5514 Mon Sep 17 00:00:00 2001 From: marvinjason Date: Wed, 21 Nov 2018 15:02:24 +0800 Subject: [PATCH 028/195] Add Norfolk Island public holidays --- index.yaml | 1 + nf.yaml | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 nf.yaml diff --git a/index.yaml b/index.yaml index 75b507c..4c72a03 100644 --- a/index.yaml +++ b/index.yaml @@ -76,3 +76,4 @@ defs: SG: ['sg.yaml'] MY: ['my.yaml'] NA: ['na.yaml'] + NF: ['nf.yaml'] diff --git a/nf.yaml b/nf.yaml new file mode 100644 index 0000000..0063c34 --- /dev/null +++ b/nf.yaml @@ -0,0 +1,86 @@ +# Liberian holiday definitions for the Ruby Holiday gem. +# +# Updated: 2018-11-21. +# +# Sources: +# - https://publicholidays.asia/norfolk-island/2018-dates/ +# - https://publicholidays.asia/norfolk-island/2019-dates/ +# - https://publicholidays.asia/norfolk-island/2020-dates/ +# - https://en.wikipedia.org/wiki/Public_holidays_in_Norfolk_Island +--- +months: + 0: + - name: Good Friday + regions: [nf] + function: easter(year) + function_modifier: -2 + - name: Easter Monday + regions: [nf] + function: easter(year) + function_modifier: +1 + 1: + - name: New Year's Day + regions: [nf] + mday: 1 + - name: Australia Day + regions: [nf] + mday: 26 + 3: + - name: Foundation Day + regions: [nf] + mday: 6 + 4: + - name: Easter Monday + regions: [nf] + mday: 2 + - name: Anzac Day + regions: [nf] + mday: 25 + 6: + - name: Bounty Day + regions: [nf] + mday: 8 + - name: Queen's Birthday + regions: [nf] + function: monday_after_second_saturday(year) + 10: + - name: Norfolk Island Agricultural Show + regions: [nf] + week: 2 + wday: 1 + 11: + - name: Thanksgiving Day + regions: [nf] + week: 4 + wday: 3 + 12: + - name: Christmas Day + regions: [nf] + mday: 25 + - name: Boxing Day + regions: [nf] + mday: 26 + +methods: + monday_after_second_saturday: + arguments: year + source: | + second_sat_in_jun = Date.civil(year, 6, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 6, 2, :saturday)) + second_sat_in_jun + 2 + +tests: + - given: + date: ['2018-03-30', '2019-04-19', '2020-04-10'] + regions: ['nf'] + expect: + name: 'Good Friday' + - given: + date: ['2018-04-02', '2019-04-22', '2020-04-13'] + regions: ['nf'] + expect: + name: 'Easter Monday' + - given: + date: ['2018-06-11', '2019-06-10', '2020-06-15'] + regions: ['nf'] + expect: + name: "Queen's Birthday" From de11cd586593465c336fdf2fa24b6eac36272d92 Mon Sep 17 00:00:00 2001 From: Philip Fraser Date: Wed, 13 Feb 2019 14:56:24 +1000 Subject: [PATCH 029/195] add Myanmar holidays --- index.yaml | 1 + mm.yaml | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 mm.yaml diff --git a/index.yaml b/index.yaml index 4c72a03..711a68e 100644 --- a/index.yaml +++ b/index.yaml @@ -37,6 +37,7 @@ defs: LR: ['lr.yaml'] LT: ['lt.yaml'] MA: ['ma.yaml'] + MM: ['mm.yaml'] MT_MT: ['mt_mt.yaml'] MT_EN: ['mt_en.yaml'] MX: ['mx.yaml', 'north_america_informal.yaml'] diff --git a/mm.yaml b/mm.yaml new file mode 100644 index 0000000..1909ddd --- /dev/null +++ b/mm.yaml @@ -0,0 +1,92 @@ +# Myanmar holiday (incomplete)definitions for the Ruby Holiday gem. +# +# Updated: 2019-02-13. +# Some dates in Islamic Calendar are missing. +# Sources: +# - Sourced from client via Alex Holder +--- +months: + 1: + - name: New Year's Day + regions: [mm] + mday: 1 + - name: Independence Day + regions: [mm] + mday: 4 + - name: Kayin New Year's Day + regions: [mm] + mday: 13 + 2: + - name: Union Day + regions: [mm] + mday: 12 + 3: + - name: Peasants Day + regions: [mm] + mday: 2 + - name: Tabaung Full Moon Day + regions: [mm] + mday: 20 + - name: Armed Forces Day + regions: [mm] + mday: 27 + 4: + - name: Thingyan Eve + regions: [mm] + mday: 13 + - name: Thingyan (Start of Water Festival) + regions: [mm] + mday: 14 + - name: Water Festival Day + regions: [mm] + mday: 15 + - name: Water Festival Day + regions: [mm] + mday: 16 + - name: Myanmar New Year Day + regions: [mm] + mday: 17 + 5: + - name: Labor Day / May Day + regions: [mm] + mday: 1 + - name: Kasone Full Moon Day + regions: [mm] + mday: 18 + 7: + - name: Warso Full Moon Day + regions: [mm] + mday: 16 + - name: Martyrs' Day + regions: [mm] + mday: 19 + 10: + - name: Buddhist Lent Holiday + regions: [mm] + mday: 12 + - name: Thadingyut Full Moon Day + regions: [mm] + mday: 13 + - name: Buddhist Lent Holiday + regions: [mm] + mday: 14 + 11: + - name: Tazaung Daing Holiday + regions: [mm] + mday: 10 + - name: Tazaung Daing Full Moon Day + regions: [mm] + mday: 11 + - name: National Day + regions: [mm] + mday: 21 + 12: + - name: Christmas Day + regions: [mm] + mday: 25 + - name: Kayin New Year Day + regions: [mm] + mday: 26 + - name: New Year Eve + regions: [mm] + mday: 31 From ecc8170f96b4d300719fa8a8534968ac355c6bc5 Mon Sep 17 00:00:00 2001 From: kojidelmundo Date: Mon, 4 Mar 2019 08:45:02 +0800 Subject: [PATCH 030/195] Add Christmas Day to AU holidays --- au.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index 48a9f2b..46fb77a 100644 --- a/au.yaml +++ b/au.yaml @@ -165,7 +165,7 @@ months: wday: 2 12: - name: Christmas Day # CHRISTMAS DAY - All states except SA observe on 27th (and 25th) if 25th is a Sunday - regions: [au_qld, au_nsw, au_act, au_tas, au_wa, au_vic, au_nt] + regions: [au, au_qld, au_nsw, au_act, au_tas, au_wa, au_vic, au_nt] mday: 25 observed: to_tuesday_if_sunday_or_monday_if_saturday(date) - name: Boxing Day From e4ad0bc99858f0102f20a403ed8f3abb2aa79c54 Mon Sep 17 00:00:00 2001 From: kojidelmundo Date: Mon, 4 Mar 2019 08:48:57 +0800 Subject: [PATCH 031/195] Revert "add Myanmar holidays" This reverts commit de11cd586593465c336fdf2fa24b6eac36272d92. --- index.yaml | 1 - mm.yaml | 92 ------------------------------------------------------ 2 files changed, 93 deletions(-) delete mode 100644 mm.yaml diff --git a/index.yaml b/index.yaml index 711a68e..4c72a03 100644 --- a/index.yaml +++ b/index.yaml @@ -37,7 +37,6 @@ defs: LR: ['lr.yaml'] LT: ['lt.yaml'] MA: ['ma.yaml'] - MM: ['mm.yaml'] MT_MT: ['mt_mt.yaml'] MT_EN: ['mt_en.yaml'] MX: ['mx.yaml', 'north_america_informal.yaml'] diff --git a/mm.yaml b/mm.yaml deleted file mode 100644 index 1909ddd..0000000 --- a/mm.yaml +++ /dev/null @@ -1,92 +0,0 @@ -# Myanmar holiday (incomplete)definitions for the Ruby Holiday gem. -# -# Updated: 2019-02-13. -# Some dates in Islamic Calendar are missing. -# Sources: -# - Sourced from client via Alex Holder ---- -months: - 1: - - name: New Year's Day - regions: [mm] - mday: 1 - - name: Independence Day - regions: [mm] - mday: 4 - - name: Kayin New Year's Day - regions: [mm] - mday: 13 - 2: - - name: Union Day - regions: [mm] - mday: 12 - 3: - - name: Peasants Day - regions: [mm] - mday: 2 - - name: Tabaung Full Moon Day - regions: [mm] - mday: 20 - - name: Armed Forces Day - regions: [mm] - mday: 27 - 4: - - name: Thingyan Eve - regions: [mm] - mday: 13 - - name: Thingyan (Start of Water Festival) - regions: [mm] - mday: 14 - - name: Water Festival Day - regions: [mm] - mday: 15 - - name: Water Festival Day - regions: [mm] - mday: 16 - - name: Myanmar New Year Day - regions: [mm] - mday: 17 - 5: - - name: Labor Day / May Day - regions: [mm] - mday: 1 - - name: Kasone Full Moon Day - regions: [mm] - mday: 18 - 7: - - name: Warso Full Moon Day - regions: [mm] - mday: 16 - - name: Martyrs' Day - regions: [mm] - mday: 19 - 10: - - name: Buddhist Lent Holiday - regions: [mm] - mday: 12 - - name: Thadingyut Full Moon Day - regions: [mm] - mday: 13 - - name: Buddhist Lent Holiday - regions: [mm] - mday: 14 - 11: - - name: Tazaung Daing Holiday - regions: [mm] - mday: 10 - - name: Tazaung Daing Full Moon Day - regions: [mm] - mday: 11 - - name: National Day - regions: [mm] - mday: 21 - 12: - - name: Christmas Day - regions: [mm] - mday: 25 - - name: Kayin New Year Day - regions: [mm] - mday: 26 - - name: New Year Eve - regions: [mm] - mday: 31 From 58a9c4b20125a1e62709d3bc8a52893ec403892b Mon Sep 17 00:00:00 2001 From: kojidelmundo Date: Mon, 4 Mar 2019 08:50:25 +0800 Subject: [PATCH 032/195] Revert "Revert "add Myanmar holidays"" This reverts commit e4ad0bc99858f0102f20a403ed8f3abb2aa79c54. --- index.yaml | 1 + mm.yaml | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 mm.yaml diff --git a/index.yaml b/index.yaml index 4c72a03..711a68e 100644 --- a/index.yaml +++ b/index.yaml @@ -37,6 +37,7 @@ defs: LR: ['lr.yaml'] LT: ['lt.yaml'] MA: ['ma.yaml'] + MM: ['mm.yaml'] MT_MT: ['mt_mt.yaml'] MT_EN: ['mt_en.yaml'] MX: ['mx.yaml', 'north_america_informal.yaml'] diff --git a/mm.yaml b/mm.yaml new file mode 100644 index 0000000..1909ddd --- /dev/null +++ b/mm.yaml @@ -0,0 +1,92 @@ +# Myanmar holiday (incomplete)definitions for the Ruby Holiday gem. +# +# Updated: 2019-02-13. +# Some dates in Islamic Calendar are missing. +# Sources: +# - Sourced from client via Alex Holder +--- +months: + 1: + - name: New Year's Day + regions: [mm] + mday: 1 + - name: Independence Day + regions: [mm] + mday: 4 + - name: Kayin New Year's Day + regions: [mm] + mday: 13 + 2: + - name: Union Day + regions: [mm] + mday: 12 + 3: + - name: Peasants Day + regions: [mm] + mday: 2 + - name: Tabaung Full Moon Day + regions: [mm] + mday: 20 + - name: Armed Forces Day + regions: [mm] + mday: 27 + 4: + - name: Thingyan Eve + regions: [mm] + mday: 13 + - name: Thingyan (Start of Water Festival) + regions: [mm] + mday: 14 + - name: Water Festival Day + regions: [mm] + mday: 15 + - name: Water Festival Day + regions: [mm] + mday: 16 + - name: Myanmar New Year Day + regions: [mm] + mday: 17 + 5: + - name: Labor Day / May Day + regions: [mm] + mday: 1 + - name: Kasone Full Moon Day + regions: [mm] + mday: 18 + 7: + - name: Warso Full Moon Day + regions: [mm] + mday: 16 + - name: Martyrs' Day + regions: [mm] + mday: 19 + 10: + - name: Buddhist Lent Holiday + regions: [mm] + mday: 12 + - name: Thadingyut Full Moon Day + regions: [mm] + mday: 13 + - name: Buddhist Lent Holiday + regions: [mm] + mday: 14 + 11: + - name: Tazaung Daing Holiday + regions: [mm] + mday: 10 + - name: Tazaung Daing Full Moon Day + regions: [mm] + mday: 11 + - name: National Day + regions: [mm] + mday: 21 + 12: + - name: Christmas Day + regions: [mm] + mday: 25 + - name: Kayin New Year Day + regions: [mm] + mday: 26 + - name: New Year Eve + regions: [mm] + mday: 31 From 2f61d2cc3f8788bd4f5fbe8f45050bafb7301693 Mon Sep 17 00:00:00 2001 From: kojidelmundo Date: Mon, 4 Mar 2019 08:50:54 +0800 Subject: [PATCH 033/195] Revert "Add Christmas Day to AU holidays" This reverts commit ecc8170f96b4d300719fa8a8534968ac355c6bc5. --- au.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index 46fb77a..48a9f2b 100644 --- a/au.yaml +++ b/au.yaml @@ -165,7 +165,7 @@ months: wday: 2 12: - name: Christmas Day # CHRISTMAS DAY - All states except SA observe on 27th (and 25th) if 25th is a Sunday - regions: [au, au_qld, au_nsw, au_act, au_tas, au_wa, au_vic, au_nt] + regions: [au_qld, au_nsw, au_act, au_tas, au_wa, au_vic, au_nt] mday: 25 observed: to_tuesday_if_sunday_or_monday_if_saturday(date) - name: Boxing Day From 87182f17f5a0d14fe2b85b1594e50d299282c0d9 Mon Sep 17 00:00:00 2001 From: kojidelmundo Date: Mon, 4 Mar 2019 09:24:02 +0800 Subject: [PATCH 034/195] added Christmas Day to AU holidays --- au.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index 48a9f2b..46fb77a 100644 --- a/au.yaml +++ b/au.yaml @@ -165,7 +165,7 @@ months: wday: 2 12: - name: Christmas Day # CHRISTMAS DAY - All states except SA observe on 27th (and 25th) if 25th is a Sunday - regions: [au_qld, au_nsw, au_act, au_tas, au_wa, au_vic, au_nt] + regions: [au, au_qld, au_nsw, au_act, au_tas, au_wa, au_vic, au_nt] mday: 25 observed: to_tuesday_if_sunday_or_monday_if_saturday(date) - name: Boxing Day From 047727616bd1a203349b575383f5b13ab23744c5 Mon Sep 17 00:00:00 2001 From: PTGreenwood Date: Tue, 19 Mar 2019 15:08:58 +1000 Subject: [PATCH 035/195] Removed duplicate Easter Monday implementation. --- nf.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/nf.yaml b/nf.yaml index 0063c34..24f14b1 100644 --- a/nf.yaml +++ b/nf.yaml @@ -30,9 +30,6 @@ months: regions: [nf] mday: 6 4: - - name: Easter Monday - regions: [nf] - mday: 2 - name: Anzac Day regions: [nf] mday: 25 From b64db74400711bbea6f9d0bb6e2eab5047779447 Mon Sep 17 00:00:00 2001 From: PTGreenwood Date: Tue, 19 Mar 2019 15:19:51 +1000 Subject: [PATCH 036/195] Move the observation of the Bounty Day holiday to following Monday if landed on weekend. Added tests for 2019. --- nf.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nf.yaml b/nf.yaml index 24f14b1..02ed131 100644 --- a/nf.yaml +++ b/nf.yaml @@ -37,6 +37,7 @@ months: - name: Bounty Day regions: [nf] mday: 8 + observed: to_monday_if_weekend(date) - name: Queen's Birthday regions: [nf] function: monday_after_second_saturday(year) @@ -81,3 +82,8 @@ tests: regions: ['nf'] expect: name: "Queen's Birthday" + - given: + date: ['2019-06-10'] + regions: ['nf'] + expect: + name: "Bounty Day" From df92342c98f615d6851d9a4dcbff7d5f4688c559 Mon Sep 17 00:00:00 2001 From: PTGreenwood Date: Tue, 19 Mar 2019 15:58:06 +1000 Subject: [PATCH 037/195] Removed poorly written test. --- nf.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/nf.yaml b/nf.yaml index 02ed131..8469715 100644 --- a/nf.yaml +++ b/nf.yaml @@ -82,8 +82,3 @@ tests: regions: ['nf'] expect: name: "Queen's Birthday" - - given: - date: ['2019-06-10'] - regions: ['nf'] - expect: - name: "Bounty Day" From 7a201fda2ffaecef24cb9cd7956e7eb87d37822a Mon Sep 17 00:00:00 2001 From: Alex Ghiculescu Date: Tue, 19 Mar 2019 11:51:11 -0500 Subject: [PATCH 038/195] Casimir Pulaski Day is only a holiday in Chicago --- us.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/us.yaml b/us.yaml index 49af7d0..702ca97 100644 --- a/us.yaml +++ b/us.yaml @@ -35,7 +35,6 @@ # - https://en.wikipedia.org/wiki/Washington%27s_Birthday # - https://en.wikipedia.org/wiki/Shrove_Tuesday # - https://en.wikipedia.org/wiki/Town_meeting#Vermont -# - https://en.wikipedia.org/wiki/Casimir_Pulaski_Day # - https://en.wikipedia.org/wiki/Seward%27s_Day # - https://en.wikipedia.org/wiki/Emancipation_Day # - https://en.wikipedia.org/wiki/Patriots%27_Day @@ -125,10 +124,6 @@ months: regions: [us] wday: 1 3: - - name: Casimir Pulaski Day # First Monday in March - regions: [us_il] - week: 1 - wday: 1 - name: Town Meeting Day # First Tuesday in March regions: [us_vt] week: 1 @@ -496,11 +491,6 @@ tests: regions: ["us"] expect: holiday: false - - given: - date: ['2017-3-6', '2018-3-5', '2019-3-4'] - regions: ["us_il"] - expect: - name: "Casimir Pulaski Day" - given: date: ['2017-3-7', '2018-3-6', '2019-3-5'] From 701d27caba858b14628512d0c562ce34d13af1d8 Mon Sep 17 00:00:00 2001 From: Alex Ghiculescu Date: Tue, 19 Mar 2019 11:52:22 -0500 Subject: [PATCH 039/195] Emancipation Day not recognised in CA https://en.wikipedia.org/wiki/Emancipation_Day#United_States https://www.dfeh.ca.gov/contact-us/holidays/ --- us.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/us.yaml b/us.yaml index 702ca97..3a96ce7 100644 --- a/us.yaml +++ b/us.yaml @@ -144,7 +144,7 @@ months: mday: 31 4: - name: Emancipation Day - regions: [us_dc, us_ca] + regions: [us_dc] observed: to_weekday_if_weekend(date) mday: 16 - name: Patriots' Day # Third Monday in April @@ -557,7 +557,7 @@ tests: name: "Emancipation Day" - given: date: ['2017-4-16'] - regions: ["us_dc", "us_ca"] + regions: ["us_dc"] expect: name: "Emancipation Day" From 4e0b14f84f3eb2489494b1c6ab8fb36661afd86b Mon Sep 17 00:00:00 2001 From: Alex Ghiculescu Date: Tue, 19 Mar 2019 11:54:23 -0500 Subject: [PATCH 040/195] Election Day isn't a holiday in IL https://en.wikipedia.org/wiki/Election_Day_(United_States) https://www.employmentlawhandbook.com/leave-laws/state-leave-laws/illinois/holidays/ --- us.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/us.yaml b/us.yaml index 3a96ce7..1a89c82 100644 --- a/us.yaml +++ b/us.yaml @@ -258,7 +258,7 @@ months: wday: 5 11: - name: Election Day - regions: [us_de, us_hi, us_il, us_in, us_mt, us_nj, us_ny, us_pa, us_ri] + regions: [us_de, us_hi, us_in, us_mt, us_nj, us_ny, us_pa, us_ri] function: election_day(year) - name: Veterans Day regions: [us] @@ -850,7 +850,7 @@ tests: holiday: false - given: date: ['2017-11-7', '2018-11-6', '2021-11-2'] - regions: ["us_de", "us_hi", "us_il", "us_in", "us_mt", "us_nj", "us_ny", "us_pa", "us_ri"] + regions: ["us_de", "us_hi", "us_in", "us_mt", "us_nj", "us_ny", "us_pa", "us_ri"] expect: name: "Election Day" - given: From 72c12f8af9169031a6c677feeba9af9ec64458b9 Mon Sep 17 00:00:00 2001 From: marvinjason Date: Thu, 16 May 2019 12:44:18 +0800 Subject: [PATCH 041/195] Fix ACT Reconciliation Day --- au.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/au.yaml b/au.yaml index 46fb77a..7df51c5 100644 --- a/au.yaml +++ b/au.yaml @@ -95,9 +95,8 @@ months: function: may_pub_hol_sa(year) - name: ACT Reconciliation Day regions: [au_act] - mday: 28 - year_ranges: - - after: 2018 + mday: 27 + observed: to_next_monday(date) 6: - name: Foundation Day regions: [au_wa] @@ -315,8 +314,9 @@ tests: expect: name: 'Family & Community Day' - given: - date: ['2018-05-28'] + date: ['2017-05-29', '2018-05-28', '2019-05-27', '2020-06-01'] regions: ["au_act"] + options: ["observed"] expect: name: 'ACT Reconciliation Day' - given: From 6b565b530fc45f57972c4589ea4a9369710fd3d0 Mon Sep 17 00:00:00 2001 From: Philip Fraser Date: Tue, 28 May 2019 12:00:47 +0100 Subject: [PATCH 042/195] Update bank holiday names GB --- gb.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gb.yaml b/gb.yaml index 70eba6c..5cb2ac6 100644 --- a/gb.yaml +++ b/gb.yaml @@ -46,7 +46,7 @@ months: - name: Liberation Day regions: [je, gb_jsy, gg, gb_gsy] mday: 9 - - name: Bank Holiday + - name: Spring Bank Holiday regions: [gb] week: -1 wday: 1 @@ -62,7 +62,7 @@ months: regions: [gb_sct] week: 1 wday: 1 - - name: Bank Holiday + - name: Summer Bank Holiday regions: [gb_eng, gb_wls, gb_eaw, gb_nir, je, gb_jsy, gg, gb_gsy] week: -1 wday: 1 @@ -112,7 +112,7 @@ tests: regions: ["gb"] options: ["informal"] expect: - name: "Bank Holiday" + name: "Spring Bank Holiday" - given: date: '2008-11-05' regions: ["gb"] @@ -307,7 +307,7 @@ tests: date: '2008-08-25' regions: ["gb_wls"] expect: - name: "Bank Holiday" + name: "Summer Bank Holiday" - given: date: '2008-03-24' regions: ["gb_eng"] @@ -317,7 +317,7 @@ tests: date: '2008-08-25' regions: ["gb_eng"] expect: - name: "Bank Holiday" + name: "Summer Bank Holiday" - given: date: '2008-03-24' regions: ["gb_nir"] @@ -327,7 +327,7 @@ tests: date: '2008-08-25' regions: ["gb_nir"] expect: - name: "Bank Holiday" + name: "Summer Bank Holiday" - given: date: '2008-03-24' regions: ["gb_eaw"] @@ -337,7 +337,7 @@ tests: date: '2008-08-25' regions: ["gb_eaw"] expect: - name: "Bank Holiday" + name: "Summer Bank Holiday" - given: date: '2008-03-24' regions: ["gb_"] @@ -347,7 +347,7 @@ tests: date: '2008-08-25' regions: ["gb_"] expect: - name: "Bank Holiday" + name: "Summer Bank Holiday" - given: date: '2018-05-09' regions: ["je"] @@ -362,4 +362,4 @@ tests: date: '2018-08-27' regions: ["je"] expect: - name: "Bank Holiday" \ No newline at end of file + name: "Summer Bank Holiday" From 384068b6fde2f7c6e2272efd57879172114ef9ab Mon Sep 17 00:00:00 2001 From: kojidelmundo Date: Mon, 23 Sep 2019 08:57:48 +0800 Subject: [PATCH 043/195] Add AFL Grand Final Friday 2019 --- au.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/au.yaml b/au.yaml index 7df51c5..5dc3270 100644 --- a/au.yaml +++ b/au.yaml @@ -195,6 +195,8 @@ methods: Date.civil(2017, 9, 29) when 2018 Date.civil(2018, 9, 28) + when 2019 + Date.civil(2019, 9, 27) end qld_queens_bday_october: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates From f918ba2875b6808d99275c74cf836270aef59f3e Mon Sep 17 00:00:00 2001 From: kojidelmundo Date: Mon, 23 Sep 2019 09:17:48 +0800 Subject: [PATCH 044/195] Add test for AFL Friday 2019 --- au.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/au.yaml b/au.yaml index 5dc3270..4a03916 100644 --- a/au.yaml +++ b/au.yaml @@ -478,6 +478,11 @@ tests: regions: ["au_vic"] expect: name: 'Friday before the AFL Grand Final' + - given: + date: '2019-09-27' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' - given: date: '2005-05-16' regions: ["au_sa"] From a79b7578f576797963f3d5a9e7409c2728408991 Mon Sep 17 00:00:00 2001 From: levelone Date: Fri, 13 Dec 2019 09:13:55 +0800 Subject: [PATCH 045/195] Update Melbourne Cup Day Holiday --- au.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index 4a03916..668fff7 100644 --- a/au.yaml +++ b/au.yaml @@ -159,7 +159,7 @@ months: wday: 1 week: 1 - name: Melbourne Cup Day - regions: [au_vic_melbourne] + regions: [au_vic_melbourne, au_vic] week: 1 wday: 2 12: @@ -458,6 +458,11 @@ tests: regions: ["au_vic_melbourne"] expect: name: 'Melbourne Cup Day' + - given: + date: '2019-11-05' + regions: ["au_vic"] + expect: + name: 'Melbourne Cup Day' - given: date: '2015-10-02' regions: ["au_vic"] From be0d270ab30415f1e0902a2db03fcdaf9fc4e4cf Mon Sep 17 00:00:00 2001 From: levelone Date: Tue, 17 Dec 2019 21:25:12 +0800 Subject: [PATCH 046/195] Update Melbourne Cup Holiday --- au.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index 4a03916..668fff7 100644 --- a/au.yaml +++ b/au.yaml @@ -159,7 +159,7 @@ months: wday: 1 week: 1 - name: Melbourne Cup Day - regions: [au_vic_melbourne] + regions: [au_vic_melbourne, au_vic] week: 1 wday: 2 12: @@ -458,6 +458,11 @@ tests: regions: ["au_vic_melbourne"] expect: name: 'Melbourne Cup Day' + - given: + date: '2019-11-05' + regions: ["au_vic"] + expect: + name: 'Melbourne Cup Day' - given: date: '2015-10-02' regions: ["au_vic"] From 0554e5f432fda92a873fb3444133b7437e99bbf0 Mon Sep 17 00:00:00 2001 From: Philip Fraser Date: Tue, 14 Jan 2020 08:41:10 +0100 Subject: [PATCH 047/195] Update may day uk --- gb.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gb.yaml b/gb.yaml index 5cb2ac6..5dd1658 100644 --- a/gb.yaml +++ b/gb.yaml @@ -41,8 +41,7 @@ months: 5: - name: May Day regions: [gb] - week: 1 - wday: 1 + mday: 8 - name: Liberation Day regions: [je, gb_jsy, gg, gb_gsy] mday: 9 From c478a4f055e835f85164bd54890c883415552154 Mon Sep 17 00:00:00 2001 From: Alexander Holder Date: Thu, 16 Jan 2020 12:14:03 +1000 Subject: [PATCH 048/195] Update mm.yaml --- mm.yaml | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 159 insertions(+), 3 deletions(-) diff --git a/mm.yaml b/mm.yaml index 1909ddd..eadf7ad 100644 --- a/mm.yaml +++ b/mm.yaml @@ -1,21 +1,31 @@ # Myanmar holiday (incomplete)definitions for the Ruby Holiday gem. # -# Updated: 2019-02-13. +# Updated: 2020-01-06. # Some dates in Islamic Calendar are missing. # Sources: -# - Sourced from client via Alex Holder +# - Sourced from client (KBZ BANK) via Alex Holder +# https://docs.google.com/spreadsheets/d/1S6JzcjLsH9ZeQXEh5x724aHIsuJvdK62qLM7yS-TTQY/edit?usp=sharing --- months: 1: - name: New Year's Day regions: [mm] mday: 1 + year_ranges: + - limited: 2019 - name: Independence Day regions: [mm] mday: 4 + - name: Substitute Day + regions: [mm] + mday: 6 + year_ranges: + - limited: 2020 - name: Kayin New Year's Day regions: [mm] mday: 13 + year_ranges: + - limited: 2019 2: - name: Union Day regions: [mm] @@ -24,69 +34,215 @@ months: - name: Peasants Day regions: [mm] mday: 2 + - name: Full Moon Day of Taboung + regions: [mm] + mday: 8 + year_ranges: + - limited: 2020 + - name: Substitute Day + regions: [mm] + mday: 9 + year_ranges: + - limited: 2020 - name: Tabaung Full Moon Day regions: [mm] mday: 20 + year_ranges: + - limited: 2019 - name: Armed Forces Day regions: [mm] mday: 27 4: + - name: Myanmar New Year Holiday + regions: [mm] + mday: 10 + year_ranges: + - limited: 2020 + - name: Myanmar New Year Holiday + regions: [mm] + mday: 11 + year_ranges: + - limited: 2020 + - name: Maha Thingyan (Water Festival) + regions: [mm] + mday: 12 + year_ranges: + - limited: 2020 - name: Thingyan Eve regions: [mm] mday: 13 + year_ranges: + - limited: 2019 + - name: Maha Thingyan (Water Festival) + regions: [mm] + mday: 13 + year_ranges: + - limited: 2020 - name: Thingyan (Start of Water Festival) regions: [mm] mday: 14 + year_ranges: + - limited: 2019 + - name: Maha Thingyan (Water Festival) + regions: [mm] + mday: 14 + year_ranges: + - limited: 2020 - name: Water Festival Day regions: [mm] mday: 15 + year_ranges: + - limited: 2019 + - name: Maha Thingyan (Water Festival) + regions: [mm] + mday: 15 + year_ranges: + - limited: 2020 - name: Water Festival Day regions: [mm] mday: 16 + year_ranges: + - limited: 2019 + - name: Maha Thingyan (Water Festival) + regions: [mm] + mday: 16 + year_ranges: + - limited: 2020 - name: Myanmar New Year Day regions: [mm] mday: 17 + year_ranges: + - limited: 2019 + - name: Myanmar New Year Holiday + regions: [mm] + mday: 17 + year_ranges: + - limited: 2020 5: - name: Labor Day / May Day regions: [mm] mday: 1 + - name: Full Moon Day of Kasong + regions: [mm] + mday: 6 + year_ranges: + - limited: 2020 - name: Kasone Full Moon Day regions: [mm] mday: 18 - 7: + year_ranges: + - limited: 2019 + 6: - name: Warso Full Moon Day regions: [mm] mday: 16 + year_ranges: + - limited: 2019 - name: Martyrs' Day regions: [mm] mday: 19 + - name: Substitute Day + regions: [mm] + mday: 20 + year_ranges: + - limited: 2020 + 7: + - name: Full Moon Day of Waso (Beginning of Buddhist Lent) + regions: [mm] + mday: 3 + year_ranges: + - limited: 2020 10: - name: Buddhist Lent Holiday regions: [mm] mday: 12 + year_ranges: + - limited: 2019 - name: Thadingyut Full Moon Day regions: [mm] mday: 13 + year_ranges: + - limited: 2019 - name: Buddhist Lent Holiday regions: [mm] mday: 14 + year_ranges: + - limited: 2019 + - name: Thadingyut Holiday + regions: [mm] + mday: 29 + year_ranges: + - limited: 2020 + - name: Thadingyut Holiday + regions: [mm] + mday: 30 + year_ranges: + - limited: 2020 + - name: Full Moon Day of Thadingyut (End of Buddhist Lent) + regions: [mm] + mday: 31 + year_ranges: + - limited: 2020 11: + - name: Thadingyut Holiday + regions: [mm] + mday: 1 + year_ranges: + - limited: 2020 + - name: Thadingyut Holiday + regions: [mm] + mday: 2 + year_ranges: + - limited: 2020 - name: Tazaung Daing Holiday regions: [mm] mday: 10 + year_ranges: + - limited: 2019 - name: Tazaung Daing Full Moon Day regions: [mm] mday: 11 + year_ranges: + - limited: 2019 - name: National Day regions: [mm] mday: 21 + year_ranges: + - limited: 2019 + - name: Dasaung Taing Holiday + regions: [mm] + mday: 27 + year_ranges: + - limited: 2020 + - name: Dasaung Taing Holiday + regions: [mm] + mday: 28 + year_ranges: + - limited: 2020 + - name: Dasaung Taing Full Mon Day + regions: [mm] + mday: 29 + year_ranges: + - limited: 2020 + - name: Dasaung Taing Holiday + regions: [mm] + mday: 30 + year_ranges: + - limited: 2020 12: + - name: National Day + regions: [mm] + mday: 9 + year_ranges: + - limited: 2020 - name: Christmas Day regions: [mm] mday: 25 - name: Kayin New Year Day regions: [mm] mday: 26 + year_ranges: + - limited: 2019 - name: New Year Eve regions: [mm] mday: 31 From c2513125cdf5554206c31a9a5620af756c08fc9e Mon Sep 17 00:00:00 2001 From: marvinjason Date: Thu, 23 Jan 2020 09:58:55 +0800 Subject: [PATCH 049/195] Fix Australia Day and Boxing Day for Norfolk --- nf.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nf.yaml b/nf.yaml index 8469715..12fa0a4 100644 --- a/nf.yaml +++ b/nf.yaml @@ -25,6 +25,7 @@ months: - name: Australia Day regions: [nf] mday: 26 + observed: to_monday_if_weekend(date) 3: - name: Foundation Day regions: [nf] @@ -58,6 +59,7 @@ months: - name: Boxing Day regions: [nf] mday: 26 + observed: to_monday_if_weekend(date) methods: monday_after_second_saturday: @@ -82,3 +84,15 @@ tests: regions: ['nf'] expect: name: "Queen's Birthday" + - given: + date: ['2019-01-28', '2020-01-27'] + regions: ['nf'] + options: ["observed"] + expect: + name: "Australia Day" + - given: + date: ['2019-12-26', '2020-12-28'] + regions: ['nf'] + options: ["observed"] + expect: + name: "Boxing Day" From fbb6e8f01782b463043b75b2865b28532bd1fe6b Mon Sep 17 00:00:00 2001 From: adamlyons2 Date: Wed, 15 Apr 2020 21:56:10 +1000 Subject: [PATCH 050/195] FIX: ACT observes ANZAC Day on Monday if it falls on the weekend at all - same as WA --- au.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/au.yaml b/au.yaml index 668fff7..fa2ff01 100644 --- a/au.yaml +++ b/au.yaml @@ -75,11 +75,11 @@ months: regions: [au] mday: 25 - name: ANZAC Day - regions: [au_nsw, au_vic, au_qld, au_nt, au_act, au_sa, au_tas] + regions: [au_nsw, au_vic, au_qld, au_nt, au_sa, au_tas] mday: 25 observed: to_monday_if_sunday(date) - name: ANZAC Day - regions: [au_wa] + regions: [au_wa, au_act] mday: 25 observed: to_monday_if_weekend(date) 5: From 81ce87b27401eaeaed299ac94eb017d6aabf25e4 Mon Sep 17 00:00:00 2001 From: Jye Bussa Date: Tue, 13 Oct 2020 12:15:06 +1000 Subject: [PATCH 051/195] add grandfinal 2020 public holiday --- au.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/au.yaml b/au.yaml index fa2ff01..9756ae6 100644 --- a/au.yaml +++ b/au.yaml @@ -197,6 +197,8 @@ methods: Date.civil(2018, 9, 28) when 2019 Date.civil(2019, 9, 27) + when 2020 + Date.civil(2020, 10, 23) end qld_queens_bday_october: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates @@ -488,6 +490,11 @@ tests: regions: ["au_vic"] expect: name: 'Friday before the AFL Grand Final' + - given: + date: '2020-10-23' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' - given: date: '2005-05-16' regions: ["au_sa"] From ffc4b097034281ee64356567798520d10e715e2d Mon Sep 17 00:00:00 2001 From: Jye Bussa Date: Wed, 14 Oct 2020 08:58:45 +1000 Subject: [PATCH 052/195] syntax --- au.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/au.yaml b/au.yaml index 9756ae6..893fda9 100644 --- a/au.yaml +++ b/au.yaml @@ -491,10 +491,10 @@ tests: expect: name: 'Friday before the AFL Grand Final' - given: - date: '2020-10-23' - regions: ["au_vic"] - expect: - name: 'Friday before the AFL Grand Final' + date: '2020-10-23' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' - given: date: '2005-05-16' regions: ["au_sa"] From f9642fd7e1d132677fe73f31d1063b4fdceb0e85 Mon Sep 17 00:00:00 2001 From: Caleb Leung Date: Tue, 1 Dec 2020 14:25:44 +1000 Subject: [PATCH 053/195] manual addition of missing Boxing Day holidays for applicable states in AU --- au.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/au.yaml b/au.yaml index 893fda9..0c57591 100644 --- a/au.yaml +++ b/au.yaml @@ -171,6 +171,10 @@ months: regions: [au_nsw, au_vic, au_qld, au_act, au_wa] mday: 26 observed: to_tuesday_if_sunday_or_monday_if_saturday(date) + - name: Additional public holiday for Boxing Day # BOXING DAY ADDITIONAL - for States that recognise both the actual day (if on weekend) and the adjusted observed day + regions: [au_nsw, au_vic, au_qld, au_act, au_wa] + mday: 26 + function: additiona_boxing_day(date) - name: Boxing Day regions: [au_tas, au_nt] function: to_weekday_if_boxing_weekend_from_year(year) @@ -270,6 +274,16 @@ methods: else Date.civil(year, 5, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 5, :third, :monday)) end + additiona_boxing_day: + # https://www.fairwork.gov.au/leave/public-holidays + # If Boxing Day falls on a weekend (Saturday / Sunday), the public holiday rates will be paid on both the weekend date and the observed date (e. Monday / Tuesday) and the additional day will use the term 'additional public holiday'. + arguments: date + source: | + if [0,6].include?(date.wday) + date + else + nil + end tests: - given: From ebc4f864a8d655526e40fee554adcc65b07c87e2 Mon Sep 17 00:00:00 2001 From: Caleb Leung Date: Tue, 1 Dec 2020 14:33:19 +1000 Subject: [PATCH 054/195] add tests for additional boxing-day ph --- au.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/au.yaml b/au.yaml index 0c57591..3dac7f3 100644 --- a/au.yaml +++ b/au.yaml @@ -556,6 +556,11 @@ tests: options: ["observed"] expect: name: "Boxing Day" + - given: + date: '2020-12-26' + regions: ["au_qld"] + expect: + name: "Additional public holiday for Boxing Day" - given: date: '2015-12-26' regions: ["au_sa"] From 4557781e142e9c00cfe9b38cecacc28ec03db182 Mon Sep 17 00:00:00 2001 From: Caleb Leung Date: Wed, 2 Dec 2020 14:40:19 +1000 Subject: [PATCH 055/195] adding additional ph definitions for anzac/xmax/boxing day in prep for 2021 AU --- au.yaml | 94 +++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 74 insertions(+), 20 deletions(-) diff --git a/au.yaml b/au.yaml index 3dac7f3..ebb0bc1 100644 --- a/au.yaml +++ b/au.yaml @@ -71,17 +71,17 @@ months: week: 2 wday: 1 4: - - name: ANZAC Day - regions: [au] - mday: 25 - - name: ANZAC Day - regions: [au_nsw, au_vic, au_qld, au_nt, au_sa, au_tas] + - name: ANZAC Day # ANZAC DAY ACTUAL + regions: [au_nsw, au_sa, au_tas, au_vic, au_wa] mday: 25 - observed: to_monday_if_sunday(date) - - name: ANZAC Day - regions: [au_wa, au_act] + - name: ANZAC Day # ANZAC DAY OBSERVED - no additional recognised + regions: [au_act, au_nt, au_qld] mday: 25 observed: to_monday_if_weekend(date) + - name: Additional public holiday for ANZAC Day # ADDITIONAL ANZAC DAY + regions: [au_sa, au_wa] + mday: 25 + function: additional_anzac_on_monday_if_on_weekend(date) 5: - name: Labour Day regions: [au_qld] @@ -163,21 +163,28 @@ months: week: 1 wday: 2 12: - - name: Christmas Day # CHRISTMAS DAY - All states except SA observe on 27th (and 25th) if 25th is a Sunday - regions: [au, au_qld, au_nsw, au_act, au_tas, au_wa, au_vic, au_nt] + - name: Christmas Day # CHRISTMAS DAY ACTUAL - Recognised by ALL states expect for NT + regions: [au, au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa] + mday: 25 + - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY - Recognised by ALL states expect for NT + regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa] + mday: 25 + function: additional_holiday_if_on_weekend(date) + - name: Christmas Day # CHRISTMAS DAY OBSERVED - Only NT as they dont have an additional observed if on weekend + regions: [au_nt] mday: 25 observed: to_tuesday_if_sunday_or_monday_if_saturday(date) - - name: Boxing Day - regions: [au_nsw, au_vic, au_qld, au_act, au_wa] + - name: Boxing Day # BOXING DAY ACTUAL - Recognised by ALL states expect for NT + regions: [au, au_act, au_nsw, au_qld, au_sa, au_vic, au_wa] mday: 26 - observed: to_tuesday_if_sunday_or_monday_if_saturday(date) - - name: Additional public holiday for Boxing Day # BOXING DAY ADDITIONAL - for States that recognise both the actual day (if on weekend) and the adjusted observed day - regions: [au_nsw, au_vic, au_qld, au_act, au_wa] + - name: Additional public holiday Boxing Day # ADDITIONAL BOXING DAY - Recognised by ALL states expect for NT / TAS + regions: [au_act, au_nsw, au_qld, au_sa, au_vic, au_wa] mday: 26 - function: additiona_boxing_day(date) - - name: Boxing Day + function: additional_holiday_if_on_weekend(date) + - name: Boxing Day # BOXING DAY OBSERVED - Only NT & TAS as they dont have an additional observed if on weekend regions: [au_tas, au_nt] - function: to_weekday_if_boxing_weekend_from_year(year) + mday: 26 + observed: to_tuesday_if_sunday_or_monday_if_saturday(year) - name: Proclamation Day regions: [au_sa] function: to_weekday_if_boxing_weekend_from_year_or_to_tuesday_if_monday(year) @@ -274,18 +281,65 @@ methods: else Date.civil(year, 5, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 5, :third, :monday)) end - additiona_boxing_day: + additional_holiday_if_on_weekend: # https://www.fairwork.gov.au/leave/public-holidays - # If Boxing Day falls on a weekend (Saturday / Sunday), the public holiday rates will be paid on both the weekend date and the observed date (e. Monday / Tuesday) and the additional day will use the term 'additional public holiday'. + # https://www.fairwork.gov.au/leave/public-holidays/list-of-public-holidays/list-of-public-holidays-2021 + # If Boxing Day/Christmas fall on a weekend (Saturday / Sunday), the public holiday rates will be paid on both the weekend date and the observed date (e. Monday / Tuesday) and the additional day will use the term 'Additional public holiday'. arguments: date source: | if [0,6].include?(date.wday) + date += 2 date else nil end + additional_anzac_on_monday_if_on_weekend: + # https://www.fairwork.gov.au/leave/public-holidays + # https://www.fairwork.gov.au/leave/public-holidays/list-of-public-holidays/list-of-public-holidays-2021 + # SA and WA recognise additional anzac holidays on monday if on the weekend + arguments: date + source: | + return nil unless [0,6].include?(date.wday) + date += 2 if date.wday == 6 + date += 1 if date.wday == 0 + date tests: + - given: + date: '2020-04-25' + regions: ["au_act"] + expect: + name: 'ANZAC Day' + - given: + date: '2020-04-25' + regions: ["au_qld"] + expect: + name: 'ANZAC Day' + - given: + date: '2021-04-27' + regions: ["au_wa"] + expect: + name: 'Additional public holiday for ANZAC Day' + - given: + date: '2021-12-25' + regions: ["au_qld"] + expect: + name: 'Christmas Day' + - given: + date: '2021-12-27' + regions: ["au_qld"] + expect: + name: 'Additional public holiday for Christmas Day' + - given: + date: '2021-12-26' + regions: ["au_qld"] + expect: + name: 'Boxing Day' + - given: + date: '2021-12-28' + regions: ["au_qld"] + expect: + name: 'Additional public holiday for Boxing Day' - given: date: '2013-10-07' regions: ["au_qld"] From ada3b41f7e4f0b09348e6fed33697ac9022ce5c1 Mon Sep 17 00:00:00 2001 From: Caleb Leung Date: Wed, 2 Dec 2020 14:52:50 +1000 Subject: [PATCH 056/195] missing function syntax in definitions --- au.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/au.yaml b/au.yaml index ebb0bc1..db886f8 100644 --- a/au.yaml +++ b/au.yaml @@ -74,6 +74,7 @@ months: - name: ANZAC Day # ANZAC DAY ACTUAL regions: [au_nsw, au_sa, au_tas, au_vic, au_wa] mday: 25 + function: return_actual_date(date) - name: ANZAC Day # ANZAC DAY OBSERVED - no additional recognised regions: [au_act, au_nt, au_qld] mday: 25 @@ -166,6 +167,7 @@ months: - name: Christmas Day # CHRISTMAS DAY ACTUAL - Recognised by ALL states expect for NT regions: [au, au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa] mday: 25 + function: return_actual_date(date) - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY - Recognised by ALL states expect for NT regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa] mday: 25 @@ -177,6 +179,7 @@ months: - name: Boxing Day # BOXING DAY ACTUAL - Recognised by ALL states expect for NT regions: [au, au_act, au_nsw, au_qld, au_sa, au_vic, au_wa] mday: 26 + function: return_actual_date(date) - name: Additional public holiday Boxing Day # ADDITIONAL BOXING DAY - Recognised by ALL states expect for NT / TAS regions: [au_act, au_nsw, au_qld, au_sa, au_vic, au_wa] mday: 26 @@ -303,6 +306,10 @@ methods: date += 2 if date.wday == 6 date += 1 if date.wday == 0 date + return_actual_date: + arguments: date + source: | + return date tests: - given: From 42ffeae5ef6d10cfb0e06dea527dbae8e97ccaf2 Mon Sep 17 00:00:00 2001 From: Caleb Leung Date: Wed, 2 Dec 2020 14:58:48 +1000 Subject: [PATCH 057/195] revert previous change --- au.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/au.yaml b/au.yaml index db886f8..ebb0bc1 100644 --- a/au.yaml +++ b/au.yaml @@ -74,7 +74,6 @@ months: - name: ANZAC Day # ANZAC DAY ACTUAL regions: [au_nsw, au_sa, au_tas, au_vic, au_wa] mday: 25 - function: return_actual_date(date) - name: ANZAC Day # ANZAC DAY OBSERVED - no additional recognised regions: [au_act, au_nt, au_qld] mday: 25 @@ -167,7 +166,6 @@ months: - name: Christmas Day # CHRISTMAS DAY ACTUAL - Recognised by ALL states expect for NT regions: [au, au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa] mday: 25 - function: return_actual_date(date) - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY - Recognised by ALL states expect for NT regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa] mday: 25 @@ -179,7 +177,6 @@ months: - name: Boxing Day # BOXING DAY ACTUAL - Recognised by ALL states expect for NT regions: [au, au_act, au_nsw, au_qld, au_sa, au_vic, au_wa] mday: 26 - function: return_actual_date(date) - name: Additional public holiday Boxing Day # ADDITIONAL BOXING DAY - Recognised by ALL states expect for NT / TAS regions: [au_act, au_nsw, au_qld, au_sa, au_vic, au_wa] mday: 26 @@ -306,10 +303,6 @@ methods: date += 2 if date.wday == 6 date += 1 if date.wday == 0 date - return_actual_date: - arguments: date - source: | - return date tests: - given: From 1354739b344e0681cc3735efcee6012cfe953006 Mon Sep 17 00:00:00 2001 From: Caleb Leung Date: Wed, 2 Dec 2020 15:02:43 +1000 Subject: [PATCH 058/195] fix wrong argument parsed to observed method boxing day --- au.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index ebb0bc1..6560fed 100644 --- a/au.yaml +++ b/au.yaml @@ -184,7 +184,7 @@ months: - name: Boxing Day # BOXING DAY OBSERVED - Only NT & TAS as they dont have an additional observed if on weekend regions: [au_tas, au_nt] mday: 26 - observed: to_tuesday_if_sunday_or_monday_if_saturday(year) + observed: to_tuesday_if_sunday_or_monday_if_saturday(date) - name: Proclamation Day regions: [au_sa] function: to_weekday_if_boxing_weekend_from_year_or_to_tuesday_if_monday(year) From 94aa8d229411a31784730617225863b3d6242729 Mon Sep 17 00:00:00 2001 From: Caleb Leung Date: Wed, 2 Dec 2020 19:47:20 +1000 Subject: [PATCH 059/195] sorry forgot main :au country key on anzac day actual --- au.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index 6560fed..767f096 100644 --- a/au.yaml +++ b/au.yaml @@ -72,7 +72,7 @@ months: wday: 1 4: - name: ANZAC Day # ANZAC DAY ACTUAL - regions: [au_nsw, au_sa, au_tas, au_vic, au_wa] + regions: [au, au_nsw, au_sa, au_tas, au_vic, au_wa] mday: 25 - name: ANZAC Day # ANZAC DAY OBSERVED - no additional recognised regions: [au_act, au_nt, au_qld] From 47d55adc68ed6d1854d948daf2647221e23d1811 Mon Sep 17 00:00:00 2001 From: Caleb Leung Date: Thu, 3 Dec 2020 11:23:16 +1000 Subject: [PATCH 060/195] remove :au from boxing/xmas/anzac default --- au.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/au.yaml b/au.yaml index 767f096..dadad2d 100644 --- a/au.yaml +++ b/au.yaml @@ -72,7 +72,7 @@ months: wday: 1 4: - name: ANZAC Day # ANZAC DAY ACTUAL - regions: [au, au_nsw, au_sa, au_tas, au_vic, au_wa] + regions: [au_nsw, au_sa, au_tas, au_vic, au_wa] mday: 25 - name: ANZAC Day # ANZAC DAY OBSERVED - no additional recognised regions: [au_act, au_nt, au_qld] @@ -164,7 +164,7 @@ months: wday: 2 12: - name: Christmas Day # CHRISTMAS DAY ACTUAL - Recognised by ALL states expect for NT - regions: [au, au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa] + regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa] mday: 25 - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY - Recognised by ALL states expect for NT regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa] @@ -175,7 +175,7 @@ months: mday: 25 observed: to_tuesday_if_sunday_or_monday_if_saturday(date) - name: Boxing Day # BOXING DAY ACTUAL - Recognised by ALL states expect for NT - regions: [au, au_act, au_nsw, au_qld, au_sa, au_vic, au_wa] + regions: [au_act, au_nsw, au_qld, au_sa, au_vic, au_wa] mday: 26 - name: Additional public holiday Boxing Day # ADDITIONAL BOXING DAY - Recognised by ALL states expect for NT / TAS regions: [au_act, au_nsw, au_qld, au_sa, au_vic, au_wa] From bf04d1cf41414af38a1efab06d9dfb4a52bb7ec4 Mon Sep 17 00:00:00 2001 From: Caleb Leung Date: Thu, 3 Dec 2020 11:43:52 +1000 Subject: [PATCH 061/195] moving SA to non-addition boxing day for 2020 --- au.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/au.yaml b/au.yaml index dadad2d..784f132 100644 --- a/au.yaml +++ b/au.yaml @@ -175,14 +175,14 @@ months: mday: 25 observed: to_tuesday_if_sunday_or_monday_if_saturday(date) - name: Boxing Day # BOXING DAY ACTUAL - Recognised by ALL states expect for NT - regions: [au_act, au_nsw, au_qld, au_sa, au_vic, au_wa] + regions: [au_act, au_nsw, au_qld, au_vic, au_wa] mday: 26 - name: Additional public holiday Boxing Day # ADDITIONAL BOXING DAY - Recognised by ALL states expect for NT / TAS - regions: [au_act, au_nsw, au_qld, au_sa, au_vic, au_wa] + regions: [au_act, au_nsw, au_qld, au_vic, au_wa] mday: 26 function: additional_holiday_if_on_weekend(date) - name: Boxing Day # BOXING DAY OBSERVED - Only NT & TAS as they dont have an additional observed if on weekend - regions: [au_tas, au_nt] + regions: [au_tas, au_nt, au_sa] # SA to be moved to additional setup in 2021 (2020 has no additionals) mday: 26 observed: to_tuesday_if_sunday_or_monday_if_saturday(date) - name: Proclamation Day From dcc1145f60d6129615d84f19846b414bdb5c9fe2 Mon Sep 17 00:00:00 2001 From: Caleb Leung Date: Mon, 7 Dec 2020 15:37:58 +1000 Subject: [PATCH 062/195] remove SA observed as it changes to additional xmas in 2021 --- au.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/au.yaml b/au.yaml index 784f132..e1b5b74 100644 --- a/au.yaml +++ b/au.yaml @@ -188,10 +188,6 @@ months: - name: Proclamation Day regions: [au_sa] function: to_weekday_if_boxing_weekend_from_year_or_to_tuesday_if_monday(year) - - name: Christmas Day # CHRISTMAS DAY - SA observes on 26th if 25th is a Sunday (Boxing Day goes to 27th) - regions: [au_sa] - mday: 25 - observed: to_monday_if_weekend(date) methods: afl_grand_final: From b7b7b0ec091171150a35a7a9a06b001ad63e4f4e Mon Sep 17 00:00:00 2001 From: Caleb Leung Date: Mon, 7 Dec 2020 19:49:17 +1000 Subject: [PATCH 063/195] remove return inside lambda def --- au.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/au.yaml b/au.yaml index e1b5b74..c2bffb8 100644 --- a/au.yaml +++ b/au.yaml @@ -295,10 +295,13 @@ methods: # SA and WA recognise additional anzac holidays on monday if on the weekend arguments: date source: | - return nil unless [0,6].include?(date.wday) - date += 2 if date.wday == 6 - date += 1 if date.wday == 0 - date + if [0,6].include?(date.wday) + date += 2 if date.wday == 6 + date += 1 if date.wday == 0 + date + else + nil + end tests: - given: From e5d5ca2d16e869ae2c073da290000b9128f5fe05 Mon Sep 17 00:00:00 2001 From: Caleb Leung Date: Wed, 9 Dec 2020 14:35:02 +1000 Subject: [PATCH 064/195] adding xmas/boxing additionals to nt also --- au.yaml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/au.yaml b/au.yaml index c2bffb8..1f07773 100644 --- a/au.yaml +++ b/au.yaml @@ -164,25 +164,21 @@ months: wday: 2 12: - name: Christmas Day # CHRISTMAS DAY ACTUAL - Recognised by ALL states expect for NT - regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa] + regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa, au_nt] mday: 25 - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY - Recognised by ALL states expect for NT - regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa] + regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa, au_nt] mday: 25 function: additional_holiday_if_on_weekend(date) - - name: Christmas Day # CHRISTMAS DAY OBSERVED - Only NT as they dont have an additional observed if on weekend - regions: [au_nt] - mday: 25 - observed: to_tuesday_if_sunday_or_monday_if_saturday(date) - name: Boxing Day # BOXING DAY ACTUAL - Recognised by ALL states expect for NT - regions: [au_act, au_nsw, au_qld, au_vic, au_wa] + regions: [au_act, au_nsw, au_qld, au_vic, au_wa, au_nt] mday: 26 - name: Additional public holiday Boxing Day # ADDITIONAL BOXING DAY - Recognised by ALL states expect for NT / TAS - regions: [au_act, au_nsw, au_qld, au_vic, au_wa] + regions: [au_act, au_nsw, au_qld, au_vic, au_wa, au_nt] mday: 26 function: additional_holiday_if_on_weekend(date) - name: Boxing Day # BOXING DAY OBSERVED - Only NT & TAS as they dont have an additional observed if on weekend - regions: [au_tas, au_nt, au_sa] # SA to be moved to additional setup in 2021 (2020 has no additionals) + regions: [au_tas, au_sa] # SA to be moved to additional setup in 2021 (2020 has no additionals) mday: 26 observed: to_tuesday_if_sunday_or_monday_if_saturday(date) - name: Proclamation Day From 4c1e6b588eaa89d4b5d06795a15ac810eee31a0b Mon Sep 17 00:00:00 2001 From: Philip Fraser Date: Mon, 4 Jan 2021 11:41:07 +0100 Subject: [PATCH 065/195] Update May Day UK --- gb.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gb.yaml b/gb.yaml index 5dd1658..5cb2ac6 100644 --- a/gb.yaml +++ b/gb.yaml @@ -41,7 +41,8 @@ months: 5: - name: May Day regions: [gb] - mday: 8 + week: 1 + wday: 1 - name: Liberation Day regions: [je, gb_jsy, gg, gb_gsy] mday: 9 From 7dcfaf7301a17f809a7f8fd5f58075895376a3f6 Mon Sep 17 00:00:00 2001 From: Philip Fraser Date: Mon, 4 Jan 2021 12:25:00 +0100 Subject: [PATCH 066/195] Update May Day in UK --- gb.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gb.yaml b/gb.yaml index 5dd1658..5cb2ac6 100644 --- a/gb.yaml +++ b/gb.yaml @@ -41,7 +41,8 @@ months: 5: - name: May Day regions: [gb] - mday: 8 + week: 1 + wday: 1 - name: Liberation Day regions: [je, gb_jsy, gg, gb_gsy] mday: 9 From 438d6e6cef08c0be87c55aae4be6adfe1e4197fa Mon Sep 17 00:00:00 2001 From: Alexander Holder Date: Tue, 19 Jan 2021 12:53:53 +1000 Subject: [PATCH 067/195] Create NZ_calendar_day.yaml --- NZ_calendar_day.yaml | 164 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 NZ_calendar_day.yaml diff --git a/NZ_calendar_day.yaml b/NZ_calendar_day.yaml new file mode 100644 index 0000000..76f8298 --- /dev/null +++ b/NZ_calendar_day.yaml @@ -0,0 +1,164 @@ +# New Zealand holiday definitions. Two options, paid as per the 'week day' or this paid on the specific calendar day +# Updated: 2010-03-28. +# Sources: +# - http://en.wikipedia.org/wiki/Public_holidays_in_New_Zealand +--- +months: + 0: + - name: Good Friday + regions: [nz] + function: easter(year) + function_modifier: -2 + - name: Easter Monday + regions: [nz] + function: easter(year) + function_modifier: 1 + 1: + - name: New Year's Day + regions: [nz] + mday: 1 + - name: Day after New Year's Day + regions: [nz] + mday: 2 + - name: Southland Anniversary Day + regions: [nz_sl] + mday: 17 + - name: Wellington Anniversary Day + regions: [nz_we] + mday: 22 + - name: Auckland Anniversary Day + regions: [nz_ak] + mday: 29 + - name: Northland Anniversary Day + regions: [nz_nl] + mday: 29 + 2: + - name: Nelson Anniversary Day + regions: [nz_ne] + mday: 1 + - name: Waitangi Day + regions: [nz] + mday: 6 + 3: + - name: Otago Anniversary Day + regions: [nz_ot] + mday: 23 + - name: Taranaki Anniversary Day + regions: [nz_ta] + week: 2 + wday: 1 + 4: + - name: ANZAC Day + regions: [nz] + mday: 25 + 6: + - name: Queen's Birthday + regions: [nz] + week: 1 + wday: 1 + 9: + - name: Dominion Day + regions: [nz_sc] + week: 4 + wday: 1 + 10: + - name: Hawke's bay Anniversary Day + regions: [nz_hb] + week: 1 + wday: 1 + - name: Labour Day + regions: [nz] + week: 4 + wday: 1 + - name: Marlborough Anniversary Day + regions: [nz_mb] + week: 4 + wday: 1 + 11: + - name: Canterbury Anniversary Day + regions: [nz_ca] + week: 2 + wday: 5 + - name: Chatham Island Anniversary Day + regions: [nz_ch] + mday: 30 + 12: + - name: Westland Anniversary Day + regions: [nz_wl] + mday: 1 + - name: Christmas Day + regions: [nz] + mday: 25 + - name: Boxing Day + regions: [nz] + mday: 26 + +tests: + - given: + date: '2007-01-01' + regions: ["nz"] + options: ["informal"] + expect: + name: "New Year's Day" + - given: + date: '2007-01-02' + regions: ["nz"] + options: ["informal"] + expect: + name: "Day after New Year's Day" + - given: + date: '2007-02-06' + regions: ["nz"] + options: ["informal"] + expect: + name: "Waitangi Day" + - given: + date: '2007-04-06' + regions: ["nz"] + options: ["informal"] + expect: + name: "Good Friday" + - given: + date: '2007-04-09' + regions: ["nz"] + options: ["informal"] + expect: + name: "Easter Monday" + - given: + date: '2007-04-25' + regions: ["nz"] + options: ["informal"] + expect: + name: "ANZAC Day" + - given: + date: '2007-12-25' + regions: ["nz"] + options: ["informal"] + expect: + name: "Christmas Day" + - given: + date: '2007-12-26' + regions: ["nz"] + options: ["informal"] + expect: + name: "Boxing Day" + - given: + date: '2015-04-25' + regions: ["nz"] + expect: + name: "ANZAC Day" + - given: + date: '2016-04-25' + regions: ["nz"] + expect: + name: "ANZAC Day" + - given: + date: '2015-02-06' + regions: ["nz"] + expect: + name: "Waitangi Day" + - given: + date: '2016-02-06' + regions: ["nz"] + expect: + name: "Waitangi Day" From cc7698ae9b61908aeab15418979eace3f62948cf Mon Sep 17 00:00:00 2001 From: Alexander Holder Date: Tue, 19 Jan 2021 13:02:50 +1000 Subject: [PATCH 068/195] Rename NZ_calendar_day.yaml to NZ_calendar_dates.yaml --- NZ_calendar_day.yaml => NZ_calendar_dates.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename NZ_calendar_day.yaml => NZ_calendar_dates.yaml (100%) diff --git a/NZ_calendar_day.yaml b/NZ_calendar_dates.yaml similarity index 100% rename from NZ_calendar_day.yaml rename to NZ_calendar_dates.yaml From e0f7c21bc8cbf6ec89813ce25b387c08dec0239d Mon Sep 17 00:00:00 2001 From: Alexander Holder Date: Wed, 20 Jan 2021 13:50:12 +1000 Subject: [PATCH 069/195] Rename NZ_calendar_dates.yaml to nz_calendar_dates.yaml --- NZ_calendar_dates.yaml => nz_calendar_dates.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename NZ_calendar_dates.yaml => nz_calendar_dates.yaml (100%) diff --git a/NZ_calendar_dates.yaml b/nz_calendar_dates.yaml similarity index 100% rename from NZ_calendar_dates.yaml rename to nz_calendar_dates.yaml From 6e2f47b8ded285735a902380c9726ba712a17a57 Mon Sep 17 00:00:00 2001 From: Alexander Holder Date: Wed, 20 Jan 2021 13:50:24 +1000 Subject: [PATCH 070/195] Update index.yaml --- index.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.yaml b/index.yaml index 711a68e..2a13d31 100644 --- a/index.yaml +++ b/index.yaml @@ -47,7 +47,7 @@ defs: LU: ['lu.yaml'] "NO": ['no.yaml'] NYSE: ['nyse.yaml'] - NZ: ['nz.yaml'] + NZ: ['nz.yaml', 'nz_calendar_dates.yaml '] PE: ['pe.yaml'] PH: ['ph.yaml'] PK: ['pk.yaml'] From 43bd9f669e8ad689a8291839fcc6129f05fec264 Mon Sep 17 00:00:00 2001 From: Alexander Holder Date: Wed, 20 Jan 2021 13:58:23 +1000 Subject: [PATCH 071/195] Update index.yaml --- index.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.yaml b/index.yaml index 2a13d31..ddf09f9 100644 --- a/index.yaml +++ b/index.yaml @@ -47,7 +47,7 @@ defs: LU: ['lu.yaml'] "NO": ['no.yaml'] NYSE: ['nyse.yaml'] - NZ: ['nz.yaml', 'nz_calendar_dates.yaml '] + NZ: ['nz.yaml', 'nz_calendar_dates.yaml'] PE: ['pe.yaml'] PH: ['ph.yaml'] PK: ['pk.yaml'] From 7b08a0bf20285af720cdfb74a1a921df2dabec48 Mon Sep 17 00:00:00 2001 From: Alexander Holder Date: Wed, 20 Jan 2021 14:15:16 +1000 Subject: [PATCH 072/195] Update index.yaml --- index.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.yaml b/index.yaml index ddf09f9..9ebe009 100644 --- a/index.yaml +++ b/index.yaml @@ -47,7 +47,8 @@ defs: LU: ['lu.yaml'] "NO": ['no.yaml'] NYSE: ['nyse.yaml'] - NZ: ['nz.yaml', 'nz_calendar_dates.yaml'] + NZ: ['nz.yaml'] + NZ_Calendar_Dates: ['nz_calendar_dates.yaml'] PE: ['pe.yaml'] PH: ['ph.yaml'] PK: ['pk.yaml'] From 23bea04912a3ddec02885b7d4fcf0c0f767b990d Mon Sep 17 00:00:00 2001 From: alexanderholder Date: Thu, 21 Jan 2021 15:49:53 +1000 Subject: [PATCH 073/195] rename to nz2 --- nz_calendar_dates.yaml => nz2_calendar_dates.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename nz_calendar_dates.yaml => nz2_calendar_dates.yaml (100%) diff --git a/nz_calendar_dates.yaml b/nz2_calendar_dates.yaml similarity index 100% rename from nz_calendar_dates.yaml rename to nz2_calendar_dates.yaml From 05a432a682278cc87923156bc16741b89d9682e8 Mon Sep 17 00:00:00 2001 From: alexanderholder Date: Thu, 21 Jan 2021 15:54:22 +1000 Subject: [PATCH 074/195] update index for nz2 --- index.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.yaml b/index.yaml index 9ebe009..a56e442 100644 --- a/index.yaml +++ b/index.yaml @@ -48,7 +48,7 @@ defs: "NO": ['no.yaml'] NYSE: ['nyse.yaml'] NZ: ['nz.yaml'] - NZ_Calendar_Dates: ['nz_calendar_dates.yaml'] + NZ2_Calendar_Dates: ['nz2_calendar_dates.yaml'] PE: ['pe.yaml'] PH: ['ph.yaml'] PK: ['pk.yaml'] From 02b21c6e7f7ffe3e057ee3665fdb14232c5e740b Mon Sep 17 00:00:00 2001 From: alexanderholder Date: Thu, 21 Jan 2021 16:30:25 +1000 Subject: [PATCH 075/195] update all regions to be nz2 --- nz2_calendar_dates.yaml | 78 ++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/nz2_calendar_dates.yaml b/nz2_calendar_dates.yaml index 76f8298..378108a 100644 --- a/nz2_calendar_dates.yaml +++ b/nz2_calendar_dates.yaml @@ -6,159 +6,159 @@ months: 0: - name: Good Friday - regions: [nz] + regions: [nz2] function: easter(year) function_modifier: -2 - name: Easter Monday - regions: [nz] + regions: [nz2] function: easter(year) function_modifier: 1 1: - name: New Year's Day - regions: [nz] + regions: [nz2] mday: 1 - name: Day after New Year's Day - regions: [nz] + regions: [nz2] mday: 2 - name: Southland Anniversary Day - regions: [nz_sl] + regions: [nz2_sl] mday: 17 - name: Wellington Anniversary Day - regions: [nz_we] + regions: [nz2_we] mday: 22 - name: Auckland Anniversary Day - regions: [nz_ak] + regions: [nz2_ak] mday: 29 - name: Northland Anniversary Day - regions: [nz_nl] + regions: [nz2_nl] mday: 29 2: - name: Nelson Anniversary Day - regions: [nz_ne] + regions: [nz2_ne] mday: 1 - name: Waitangi Day - regions: [nz] + regions: [nz2] mday: 6 3: - name: Otago Anniversary Day - regions: [nz_ot] + regions: [nz2_ot] mday: 23 - name: Taranaki Anniversary Day - regions: [nz_ta] + regions: [nz2_ta] week: 2 wday: 1 4: - - name: ANZAC Day - regions: [nz] + - name: ANZ2AC Day + regions: [nz2] mday: 25 6: - name: Queen's Birthday - regions: [nz] + regions: [nz2] week: 1 wday: 1 9: - name: Dominion Day - regions: [nz_sc] + regions: [nz2_sc] week: 4 wday: 1 10: - name: Hawke's bay Anniversary Day - regions: [nz_hb] + regions: [nz2_hb] week: 1 wday: 1 - name: Labour Day - regions: [nz] + regions: [nz2] week: 4 wday: 1 - name: Marlborough Anniversary Day - regions: [nz_mb] + regions: [nz2_mb] week: 4 wday: 1 11: - name: Canterbury Anniversary Day - regions: [nz_ca] + regions: [nz2_ca] week: 2 wday: 5 - name: Chatham Island Anniversary Day - regions: [nz_ch] + regions: [nz2_ch] mday: 30 12: - name: Westland Anniversary Day - regions: [nz_wl] + regions: [nz2_wl] mday: 1 - name: Christmas Day - regions: [nz] + regions: [nz2] mday: 25 - name: Boxing Day - regions: [nz] + regions: [nz2] mday: 26 tests: - given: date: '2007-01-01' - regions: ["nz"] + regions: ["nz2"] options: ["informal"] expect: name: "New Year's Day" - given: date: '2007-01-02' - regions: ["nz"] + regions: ["nz2"] options: ["informal"] expect: name: "Day after New Year's Day" - given: date: '2007-02-06' - regions: ["nz"] + regions: ["nz2"] options: ["informal"] expect: name: "Waitangi Day" - given: date: '2007-04-06' - regions: ["nz"] + regions: ["nz2"] options: ["informal"] expect: name: "Good Friday" - given: date: '2007-04-09' - regions: ["nz"] + regions: ["nz2"] options: ["informal"] expect: name: "Easter Monday" - given: date: '2007-04-25' - regions: ["nz"] + regions: ["nz2"] options: ["informal"] expect: - name: "ANZAC Day" + name: "ANZ2AC Day" - given: date: '2007-12-25' - regions: ["nz"] + regions: ["nz2"] options: ["informal"] expect: name: "Christmas Day" - given: date: '2007-12-26' - regions: ["nz"] + regions: ["nz2"] options: ["informal"] expect: name: "Boxing Day" - given: date: '2015-04-25' - regions: ["nz"] + regions: ["nz2"] expect: - name: "ANZAC Day" + name: "ANZ2AC Day" - given: date: '2016-04-25' - regions: ["nz"] + regions: ["nz2"] expect: - name: "ANZAC Day" + name: "ANZ2AC Day" - given: date: '2015-02-06' - regions: ["nz"] + regions: ["nz2"] expect: name: "Waitangi Day" - given: date: '2016-02-06' - regions: ["nz"] + regions: ["nz2"] expect: name: "Waitangi Day" From f641baf75370e9d980b3c660ea083a08d6f27fe3 Mon Sep 17 00:00:00 2001 From: alexanderholder Date: Thu, 21 Jan 2021 16:45:15 +1000 Subject: [PATCH 076/195] Correct nz holiday names --- nz2_calendar_dates.yaml | 99 +++++++++++------------------------------ 1 file changed, 26 insertions(+), 73 deletions(-) diff --git a/nz2_calendar_dates.yaml b/nz2_calendar_dates.yaml index 378108a..7cebec9 100644 --- a/nz2_calendar_dates.yaml +++ b/nz2_calendar_dates.yaml @@ -6,159 +6,112 @@ months: 0: - name: Good Friday - regions: [nz2] + regions: [nz2_calendar_dates] function: easter(year) function_modifier: -2 - name: Easter Monday - regions: [nz2] + regions: [nz2_calendar_dates] function: easter(year) function_modifier: 1 1: - name: New Year's Day - regions: [nz2] + regions: [nz2_calendar_dates] mday: 1 - name: Day after New Year's Day - regions: [nz2] + regions: [nz2_calendar_dates] mday: 2 - - name: Southland Anniversary Day - regions: [nz2_sl] - mday: 17 - - name: Wellington Anniversary Day - regions: [nz2_we] - mday: 22 - - name: Auckland Anniversary Day - regions: [nz2_ak] - mday: 29 - - name: Northland Anniversary Day - regions: [nz2_nl] - mday: 29 2: - - name: Nelson Anniversary Day - regions: [nz2_ne] - mday: 1 - name: Waitangi Day - regions: [nz2] + regions: [nz2_calendar_dates] mday: 6 - 3: - - name: Otago Anniversary Day - regions: [nz2_ot] - mday: 23 - - name: Taranaki Anniversary Day - regions: [nz2_ta] - week: 2 - wday: 1 4: - - name: ANZ2AC Day - regions: [nz2] + - name: ANZAC Day + regions: [nz2_calendar_dates] mday: 25 6: - name: Queen's Birthday - regions: [nz2] + regions: [nz2_calendar_dates] week: 1 wday: 1 - 9: - - name: Dominion Day - regions: [nz2_sc] - week: 4 - wday: 1 10: - - name: Hawke's bay Anniversary Day - regions: [nz2_hb] - week: 1 - wday: 1 - name: Labour Day - regions: [nz2] - week: 4 - wday: 1 - - name: Marlborough Anniversary Day - regions: [nz2_mb] + regions: [nz2_calendar_dates] week: 4 wday: 1 - 11: - - name: Canterbury Anniversary Day - regions: [nz2_ca] - week: 2 - wday: 5 - - name: Chatham Island Anniversary Day - regions: [nz2_ch] - mday: 30 12: - - name: Westland Anniversary Day - regions: [nz2_wl] - mday: 1 - name: Christmas Day - regions: [nz2] + regions: [nz2_calendar_dates] mday: 25 - name: Boxing Day - regions: [nz2] + regions: [nz2_calendar_dates] mday: 26 tests: - given: date: '2007-01-01' - regions: ["nz2"] + regions: ["nz2_calendar_dates"] options: ["informal"] expect: name: "New Year's Day" - given: date: '2007-01-02' - regions: ["nz2"] + regions: ["nz2_calendar_dates"] options: ["informal"] expect: name: "Day after New Year's Day" - given: date: '2007-02-06' - regions: ["nz2"] + regions: ["nz2_calendar_dates"] options: ["informal"] expect: name: "Waitangi Day" - given: date: '2007-04-06' - regions: ["nz2"] + regions: ["nz2_calendar_dates"] options: ["informal"] expect: name: "Good Friday" - given: date: '2007-04-09' - regions: ["nz2"] + regions: ["nz2_calendar_dates"] options: ["informal"] expect: name: "Easter Monday" - given: date: '2007-04-25' - regions: ["nz2"] + regions: ["nz2_calendar_dates"] options: ["informal"] expect: - name: "ANZ2AC Day" + name: "ANZAC Day" - given: date: '2007-12-25' - regions: ["nz2"] + regions: ["nz2_calendar_dates"] options: ["informal"] expect: name: "Christmas Day" - given: date: '2007-12-26' - regions: ["nz2"] + regions: ["nz2_calendar_dates"] options: ["informal"] expect: name: "Boxing Day" - given: date: '2015-04-25' - regions: ["nz2"] + regions: ["nz2_calendar_dates"] expect: - name: "ANZ2AC Day" + name: "ANZAC Day" - given: date: '2016-04-25' - regions: ["nz2"] + regions: ["nz2_calendar_dates"] expect: - name: "ANZ2AC Day" + name: "ANZAC Day" - given: date: '2015-02-06' - regions: ["nz2"] + regions: ["nz2_calendar_dates"] expect: name: "Waitangi Day" - given: date: '2016-02-06' - regions: ["nz2"] + regions: ["nz2_calendar_dates"] expect: name: "Waitangi Day" From 1d6aa515f89956dd8401319282dd684d228d423e Mon Sep 17 00:00:00 2001 From: Jye Bussa Date: Fri, 16 Apr 2021 14:52:49 +1000 Subject: [PATCH 077/195] add act public holiday --- au.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index 1f07773..a605e7d 100644 --- a/au.yaml +++ b/au.yaml @@ -79,7 +79,7 @@ months: mday: 25 observed: to_monday_if_weekend(date) - name: Additional public holiday for ANZAC Day # ADDITIONAL ANZAC DAY - regions: [au_sa, au_wa] + regions: [au_sa, au_act, au_wa] mday: 25 function: additional_anzac_on_monday_if_on_weekend(date) 5: From 5f3bac3c7a6b66213f6934148160cf9db4d2b86b Mon Sep 17 00:00:00 2001 From: Jye Bussa Date: Mon, 19 Apr 2021 10:27:34 +1000 Subject: [PATCH 078/195] fix --- au.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/au.yaml b/au.yaml index a605e7d..bb39f64 100644 --- a/au.yaml +++ b/au.yaml @@ -72,10 +72,10 @@ months: wday: 1 4: - name: ANZAC Day # ANZAC DAY ACTUAL - regions: [au_nsw, au_sa, au_tas, au_vic, au_wa] + regions: [au_nsw, au_sa, au_tas, au_vic, au_act, au_wa] mday: 25 - name: ANZAC Day # ANZAC DAY OBSERVED - no additional recognised - regions: [au_act, au_nt, au_qld] + regions: [au_nt, au_qld] mday: 25 observed: to_monday_if_weekend(date) - name: Additional public holiday for ANZAC Day # ADDITIONAL ANZAC DAY From e4be68ff0933dec1f8007f031e26634cd7f7dfb3 Mon Sep 17 00:00:00 2001 From: beaugrzanich <82401629+beaugrzanich@users.noreply.github.com> Date: Wed, 2 Jun 2021 09:47:53 -0500 Subject: [PATCH 079/195] Create mu.yaml --- mu.yaml | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 mu.yaml diff --git a/mu.yaml b/mu.yaml new file mode 100644 index 0000000..3d26628 --- /dev/null +++ b/mu.yaml @@ -0,0 +1,131 @@ +# Mauritius holiday (incomplete)definitions for the Ruby Holiday gem. +# +# Updated: 2021-06-02. +# Some dates in Islamic Calendar (Eid-Ul-Fitr) are missing. +# Sources: +# - Sourced from https://www.officeholidays.com/countries/mauritius/2021 , https://www.officeholidays.com/countries/mauritius/2022 +--- +months: + 1: + - name: New Year's Day + regions: [mu] + mday: 1 + year_ranges: + - name: New Year's Holiday + regions: [mu] + mday: 2 + - name: Thaipoosam Cavadee + regions: [mu] + mday: 28 + year_ranges: + - limited: 2021 + - name: Thaipoosam Cavadee + regions: [mu] + mday: 18 + year_ranges: + - limited: 2022 + 2: + - name: Abolition of Slavery + regions: [mu] + mday: 1 + - name: Chinese Spring Festival + regions: [mu] + mday: 01 + year_ranges: + - limited: 2022 + - name: Chinese Spring Festival + regions: [mu] + mday: 12 + year_ranges: + - limited: 2021 + + 3: + - name: Maha Shivaratree + regions: [mu] + mday: 1 + year_ranges: + - limited: 2022 + - name: Maha Shivaratree + regions: [mu] + mday: 11 + year_ranges: + - limited: 2021 + - name: Independence and Republic Day + regions: [mu] + mday: 12 + 4: + - name: Ougadi + regions: [mu] + mday: 2 + year_ranges: + - limited: 2022 + - name: Ougadi + regions: [mu] + mday: 13 + year_ranges: + - limited: 2021 + 5: + - name: Labour Day + regions: [mu] + mday: 1 + 8: + - name: Assumption Day + regions: [mu] + mday: 15 + year_ranges: + - limited: 2022 + - name: Ganesh Chaturthi + regions: [mu] + mday: 31 + year_ranges: + - limited: 2022 + 9: + - name: Ganesh Chaturthi + regions: [mu] + mday: 11 + year_ranges: + - limited: 2021 + 11: + - name: All Saints' Day + regions: [mu] + mday: 1 + year_ranges: + - limited: 2021 + - name: Arrival of Indentured Labourers + regions: [mu] + mday: 2 + - name: Diwali + regions: [mu] + mday: 4 + year_ranges: + - limited: 2021 + - name: Diwali + regions: [mu] + mday: 24 + year_ranges: + - limited: 2022 + 12: + - name: Christmas Day + regions: [mu] + mday: 25 +tests: + - given: + date: '2012-01-01' + regions: ["mu"] + expect: + name: 'New Year's Day' + - given: + date: '2022-02-01' + regions: ["mu"] + expect: + name: 'Abolition of Slavery' + - given: + date: '2023-05-01' + regions: ["mu"] + expect: + name: 'Labour Day' + - given: + date: '2017-12-25' + regions: ["mu"] + expect: + name: 'Christmas Day' From faf4d5f4171836eecc1dd09f8ccb062834a20b24 Mon Sep 17 00:00:00 2001 From: beaugrzanich <82401629+beaugrzanich@users.noreply.github.com> Date: Fri, 11 Jun 2021 10:10:18 -0500 Subject: [PATCH 080/195] Add Mauritius --- index.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/index.yaml b/index.yaml index a56e442..35bd8a2 100644 --- a/index.yaml +++ b/index.yaml @@ -79,3 +79,4 @@ defs: MY: ['my.yaml'] NA: ['na.yaml'] NF: ['nf.yaml'] + MU: ['mu.yaml'] From 2672e89d7e3c1b18ed7950286a05aa6b54e92489 Mon Sep 17 00:00:00 2001 From: Tyler McWilliam <45588507+tyler-mcwilliam@users.noreply.github.com> Date: Mon, 21 Jun 2021 10:36:38 -0500 Subject: [PATCH 081/195] initial commit --- mu.yaml | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/mu.yaml b/mu.yaml index 3d26628..9775263 100644 --- a/mu.yaml +++ b/mu.yaml @@ -10,20 +10,19 @@ months: - name: New Year's Day regions: [mu] mday: 1 - year_ranges: - name: New Year's Holiday regions: [mu] mday: 2 - name: Thaipoosam Cavadee regions: [mu] mday: 28 - year_ranges: - - limited: 2021 - - name: Thaipoosam Cavadee + year_ranges: + - limited: [2021] + - name: Thaipoosam Cavadee regions: [mu] mday: 18 - year_ranges: - - limited: 2022 + year_ranges: + - limited: [2022] 2: - name: Abolition of Slavery regions: [mu] @@ -31,39 +30,38 @@ months: - name: Chinese Spring Festival regions: [mu] mday: 01 - year_ranges: - - limited: 2022 + year_ranges: + - limited: [2022] - name: Chinese Spring Festival regions: [mu] mday: 12 - year_ranges: - - limited: 2021 - + year_ranges: + - limited: [2021] 3: - - name: Maha Shivaratree + - name: Maha Shivaratree regions: [mu] mday: 1 year_ranges: - - limited: 2022 + - limited: [2022] - name: Maha Shivaratree regions: [mu] mday: 11 year_ranges: - - limited: 2021 + - limited: [2021] - name: Independence and Republic Day regions: [mu] mday: 12 4: - - name: Ougadi + - name: Ougadi regions: [mu] mday: 2 year_ranges: - - limited: 2022 + - limited: [2022] - name: Ougadi regions: [mu] mday: 13 year_ranges: - - limited: 2021 + - limited: [2021] 5: - name: Labour Day regions: [mu] @@ -73,24 +71,24 @@ months: regions: [mu] mday: 15 year_ranges: - - limited: 2022 + - limited: [2022] - name: Ganesh Chaturthi regions: [mu] mday: 31 year_ranges: - - limited: 2022 + - limited: [2022] 9: - name: Ganesh Chaturthi regions: [mu] mday: 11 year_ranges: - - limited: 2021 + - limited: [2021] 11: - name: All Saints' Day regions: [mu] mday: 1 year_ranges: - - limited: 2021 + - limited: [2021] - name: Arrival of Indentured Labourers regions: [mu] mday: 2 @@ -98,22 +96,23 @@ months: regions: [mu] mday: 4 year_ranges: - - limited: 2021 + - limited: [2021] - name: Diwali regions: [mu] mday: 24 year_ranges: - - limited: 2022 + - limited: [2022] 12: - name: Christmas Day regions: [mu] mday: 25 + tests: - given: date: '2012-01-01' regions: ["mu"] expect: - name: 'New Year's Day' + name: "New Year's Day" - given: date: '2022-02-01' regions: ["mu"] From ca6ef8f90a8db683eff9f9293911fbb3ba86ef9b Mon Sep 17 00:00:00 2001 From: Tyler McWilliam <45588507+tyler-mcwilliam@users.noreply.github.com> Date: Mon, 21 Jun 2021 11:27:22 -0500 Subject: [PATCH 082/195] update additional anzac day in au.yaml to pass tests --- au.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/au.yaml b/au.yaml index bb39f64..79b41f7 100644 --- a/au.yaml +++ b/au.yaml @@ -80,7 +80,7 @@ months: observed: to_monday_if_weekend(date) - name: Additional public holiday for ANZAC Day # ADDITIONAL ANZAC DAY regions: [au_sa, au_act, au_wa] - mday: 25 + mday: 26 function: additional_anzac_on_monday_if_on_weekend(date) 5: - name: Labour Day @@ -311,7 +311,7 @@ tests: expect: name: 'ANZAC Day' - given: - date: '2021-04-27' + date: '2021-04-26' regions: ["au_wa"] expect: name: 'Additional public holiday for ANZAC Day' From b9bdc756f371c9d435a1d0a1a8a0ea2adf5e9f20 Mon Sep 17 00:00:00 2001 From: Tyler McWilliam <45588507+tyler-mcwilliam@users.noreply.github.com> Date: Mon, 21 Jun 2021 11:53:21 -0500 Subject: [PATCH 083/195] Restore au.yaml --- au.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/au.yaml b/au.yaml index 79b41f7..bb39f64 100644 --- a/au.yaml +++ b/au.yaml @@ -80,7 +80,7 @@ months: observed: to_monday_if_weekend(date) - name: Additional public holiday for ANZAC Day # ADDITIONAL ANZAC DAY regions: [au_sa, au_act, au_wa] - mday: 26 + mday: 25 function: additional_anzac_on_monday_if_on_weekend(date) 5: - name: Labour Day @@ -311,7 +311,7 @@ tests: expect: name: 'ANZAC Day' - given: - date: '2021-04-26' + date: '2021-04-27' regions: ["au_wa"] expect: name: 'Additional public holiday for ANZAC Day' From 4954af7ea034a764f68dc1d8526dc4904de236ac Mon Sep 17 00:00:00 2001 From: Frank Li <39414003+frankisawesome@users.noreply.github.com> Date: Wed, 28 Jul 2021 10:17:44 +1000 Subject: [PATCH 084/195] Add picnic day --- au.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/au.yaml b/au.yaml index bb39f64..974a45c 100644 --- a/au.yaml +++ b/au.yaml @@ -123,6 +123,10 @@ months: regions: [au_qld_brisbane] week: -3 wday: 3 + - name: Picnic Day + regions: [au_nt] + wday: 1 + week: 1 9: - name: Queen's Birthday regions: [au_wa] From a1259d8a0609c036247595a25425a0ec3de6905b Mon Sep 17 00:00:00 2001 From: Frank Li Date: Wed, 28 Jul 2021 14:30:26 +1000 Subject: [PATCH 085/195] add test --- au.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/au.yaml b/au.yaml index 974a45c..c3b266e 100644 --- a/au.yaml +++ b/au.yaml @@ -829,3 +829,8 @@ tests: regions: ["au_qld"] expect: name: "Easter Sunday" + - given: + date: '2021-08-02' + regions: ["au-nt"] + expect: + name: "Picnic Day" From 6761eb13e2c293fcfde12cd0b98c7626d3eb0cb8 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Wed, 28 Jul 2021 14:33:27 +1000 Subject: [PATCH 086/195] fix broken syntax --- au.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/au.yaml b/au.yaml index c3b266e..549e593 100644 --- a/au.yaml +++ b/au.yaml @@ -830,7 +830,7 @@ tests: expect: name: "Easter Sunday" - given: - date: '2021-08-02' - regions: ["au-nt"] + date: '2021-08-02' + regions: ["au-nt"] expect: name: "Picnic Day" From ce51972b2c78492b33573df64122eb98fb8f428d Mon Sep 17 00:00:00 2001 From: Rohan L Date: Tue, 14 Sep 2021 13:10:57 +1000 Subject: [PATCH 087/195] AFL GF 2021 --- au.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/au.yaml b/au.yaml index 549e593..5c23f48 100644 --- a/au.yaml +++ b/au.yaml @@ -206,6 +206,8 @@ methods: Date.civil(2019, 9, 27) when 2020 Date.civil(2020, 10, 23) + when 2021 + Date.civil(2021, 9, 24) end qld_queens_bday_october: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates @@ -562,6 +564,11 @@ tests: regions: ["au_vic"] expect: name: 'Friday before the AFL Grand Final' + - given: + date: '2021-09-24' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' - given: date: '2005-05-16' regions: ["au_sa"] From 2b594b416963a3da7abd68a95f4aecbbdb918dc3 Mon Sep 17 00:00:00 2001 From: beaugrzanich <82401629+beaugrzanich@users.noreply.github.com> Date: Fri, 15 Oct 2021 14:09:17 -0500 Subject: [PATCH 088/195] Changing Christmas replacement date to Friday Currently, Christmas replacement date is going to Monday. It needs to go to Friday. --- us.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/us.yaml b/us.yaml index 1a89c82..1ecf7ad 100644 --- a/us.yaml +++ b/us.yaml @@ -10,6 +10,9 @@ # - Add missing tests and correct existing tests # - Add helpful comments # - Add a lot of used sources +# +# Changed: 2021-10-15 +# - Updated Christmas to Weekday # # Common Sources: # - http://en.wikipedia.org/wiki/Public_holidays_of_the_United_States @@ -297,7 +300,7 @@ months: - name: Christmas Day regions: [us] mday: 25 - observed: to_monday_if_weekend(date) + observed: to_weekday_if_weekend(date) - name: Day after Christmas regions: [us_ar, us_nc, us_ok, us_sc, us_tn, us_tx] mday: 26 @@ -923,7 +926,7 @@ tests: expect: holiday: false - given: - date: ['2021-12-27', '2022-12-26', '2027-12-27'] + date: ['2021-12-24', '2022-12-23', '2027-12-24'] regions: ["us"] options: ["observed"] expect: From 27d1ac4db59cd3a32f3ae2fd488133d4fbee93e4 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Thu, 28 Oct 2021 11:43:24 +1000 Subject: [PATCH 089/195] removed Melbourne Cup holiday from au_vic region and fixed a few tests --- au.yaml | 25 +++++++++++++------------ us.yaml | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/au.yaml b/au.yaml index 5c23f48..46021b5 100644 --- a/au.yaml +++ b/au.yaml @@ -162,10 +162,6 @@ months: regions: [au_tas_north] wday: 1 week: 1 - - name: Melbourne Cup Day - regions: [au_vic_melbourne, au_vic] - week: 1 - wday: 2 12: - name: Christmas Day # CHRISTMAS DAY ACTUAL - Recognised by ALL states expect for NT regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa, au_nt] @@ -317,7 +313,7 @@ tests: expect: name: 'ANZAC Day' - given: - date: '2021-04-27' + date: '2021-04-26' regions: ["au_wa"] expect: name: 'Additional public holiday for ANZAC Day' @@ -340,7 +336,7 @@ tests: date: '2021-12-28' regions: ["au_qld"] expect: - name: 'Additional public holiday for Boxing Day' + name: 'Additional public holiday Boxing Day' - given: date: '2013-10-07' regions: ["au_qld"] @@ -457,7 +453,7 @@ tests: date: '2015-12-26' regions: ["au_tas"] expect: - holiday: false + name: 'Boxing Day' - given: date: '2015-11-14' regions: ["au_qld_brisbane"] @@ -467,12 +463,12 @@ tests: date: '2015-12-26' regions: ["au_nt"] expect: - holiday: false + name: 'Boxing Day' - given: date: '2016-12-27' regions: ["au_sa"] expect: - name: 'Proclamation Day' + name: 'Additional public holiday for Christmas Day' - given: date: '2016-12-25' regions: ["au_nt"] @@ -523,17 +519,22 @@ tests: date: '2014-11-04' regions: ["au_vic_melbourne"] expect: - name: 'Melbourne Cup Day' + holiday: false - given: date: '2015-11-03' regions: ["au_vic_melbourne"] expect: - name: 'Melbourne Cup Day' + holiday: false - given: date: '2019-11-05' regions: ["au_vic"] expect: - name: 'Melbourne Cup Day' + holiday: false + - given: + date: '2021-11-02' + regions: ["au_vic"] + expect: + holiday: false - given: date: '2015-10-02' regions: ["au_vic"] diff --git a/us.yaml b/us.yaml index 1ecf7ad..27dd0d1 100644 --- a/us.yaml +++ b/us.yaml @@ -926,7 +926,7 @@ tests: expect: holiday: false - given: - date: ['2021-12-24', '2022-12-23', '2027-12-24'] + date: ['2021-12-24', '2022-12-26', '2027-12-24'] regions: ["us"] options: ["observed"] expect: From 1edf0c75f879c395d2db138105a61e0b4f12cdf4 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Mon, 1 Nov 2021 13:43:10 +1000 Subject: [PATCH 090/195] fixed USA holiday tests --- us.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/us.yaml b/us.yaml index 27dd0d1..4d271f0 100644 --- a/us.yaml +++ b/us.yaml @@ -921,12 +921,12 @@ tests: name: "Christmas Eve" - given: - date: ['2021-12-27', '2022-12-26', '2027-12-27'] + date: ['2021-12-24', '2022-12-24', '2027-12-23'] regions: ["us"] expect: holiday: false - given: - date: ['2021-12-24', '2022-12-26', '2027-12-24'] + date: ['2021-12-27', '2022-12-26', '2027-12-24'] regions: ["us"] options: ["observed"] expect: From da015f72d6aa122f859670730ad4d7eb44b169d7 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 2 Nov 2021 13:54:33 +0000 Subject: [PATCH 091/195] Updating Public Holidays for UK 2022 --- gb.yaml | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/gb.yaml b/gb.yaml index 5cb2ac6..20faba9 100644 --- a/gb.yaml +++ b/gb.yaml @@ -39,7 +39,7 @@ months: regions: [gb_nir] mday: 17 5: - - name: May Day + - name: Early May bank holiday regions: [gb] week: 1 wday: 1 @@ -50,6 +50,20 @@ months: regions: [gb] week: -1 wday: 1 + year_ranges: + - before: 2022 + - after: 2022 + 6: + - name: Spring Bank Holiday + regions: [gb] + mday: 2 + year_ranges: + - limited: [2022] + - name: Platinum Jubilee bank holiday + regions: [gb] + mday: 3 + year_ranges: + - limited: [2022] 7: - name: Tynwald Day regions: [im, gb_iom] @@ -85,14 +99,30 @@ months: year_ranges: - after: 2007 12: - - name: Christmas Day + - name: Christmas Day regions: [gb] - mday: 25 + mday: 25 observed: to_monday_if_weekend(date) + year_ranges: + - before: 2022 + - after: 2022 - name: Boxing Day regions: [gb] mday: 26 observed: to_weekday_if_boxing_weekend(date) + year_ranges: + - before: 2022 + - after: 2022 + - name: Christmas Day (substitute day) + regions: [gb] + mday: 27 + year_ranges: + - limited: [2022] + - name: Boxing Day + regions: [gb] + mday: 26 + year_ranges: + - limited: [2022] tests: - given: @@ -106,13 +136,25 @@ tests: regions: ["gb"] options: ["informal"] expect: - name: "May Day" + name: "Early May bank holiday" - given: date: '2008-05-26' regions: ["gb"] options: ["informal"] expect: name: "Spring Bank Holiday" + - given: + date: '2022-06-02' + regions: ["gb"] + options: ["informal"] + expect: + name: "Spring Bank Holiday" + - given: + date: '2022-06-03' + regions: ["gb"] + options: ["informal"] + expect: + name: "Platinum Jubilee bank holiday" - given: date: '2008-11-05' regions: ["gb"] @@ -125,6 +167,18 @@ tests: options: ["informal"] expect: name: "Christmas Day" + - given: + date: '2022-12-25' + regions: ["gb"] + options: ["informal"] + expect: + holiday: false + - given: + date: '2022-12-27' + regions: ["gb"] + options: ["informal"] + expect: + name: "Christmas Day" - given: date: '2008-12-26' regions: ["gb"] From 24b819ad0d21c5d5526862a3a5de65d7cadd50a5 Mon Sep 17 00:00:00 2001 From: Chris C Date: Wed, 3 Nov 2021 13:30:06 +1000 Subject: [PATCH 092/195] Revert "fixed USA holiday tests" --- us.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/us.yaml b/us.yaml index 4d271f0..27dd0d1 100644 --- a/us.yaml +++ b/us.yaml @@ -921,12 +921,12 @@ tests: name: "Christmas Eve" - given: - date: ['2021-12-24', '2022-12-24', '2027-12-23'] + date: ['2021-12-27', '2022-12-26', '2027-12-27'] regions: ["us"] expect: holiday: false - given: - date: ['2021-12-27', '2022-12-26', '2027-12-24'] + date: ['2021-12-24', '2022-12-26', '2027-12-24'] regions: ["us"] options: ["observed"] expect: From 71cb5d11a28b480cf4845a2ab9764fc158964017 Mon Sep 17 00:00:00 2001 From: Chris C Date: Wed, 3 Nov 2021 13:30:33 +1000 Subject: [PATCH 093/195] Revert "removed Melbourne Cup holiday from au_vic region and fixed a few tests" --- au.yaml | 25 ++++++++++++------------- us.yaml | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/au.yaml b/au.yaml index 46021b5..5c23f48 100644 --- a/au.yaml +++ b/au.yaml @@ -162,6 +162,10 @@ months: regions: [au_tas_north] wday: 1 week: 1 + - name: Melbourne Cup Day + regions: [au_vic_melbourne, au_vic] + week: 1 + wday: 2 12: - name: Christmas Day # CHRISTMAS DAY ACTUAL - Recognised by ALL states expect for NT regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa, au_nt] @@ -313,7 +317,7 @@ tests: expect: name: 'ANZAC Day' - given: - date: '2021-04-26' + date: '2021-04-27' regions: ["au_wa"] expect: name: 'Additional public holiday for ANZAC Day' @@ -336,7 +340,7 @@ tests: date: '2021-12-28' regions: ["au_qld"] expect: - name: 'Additional public holiday Boxing Day' + name: 'Additional public holiday for Boxing Day' - given: date: '2013-10-07' regions: ["au_qld"] @@ -453,7 +457,7 @@ tests: date: '2015-12-26' regions: ["au_tas"] expect: - name: 'Boxing Day' + holiday: false - given: date: '2015-11-14' regions: ["au_qld_brisbane"] @@ -463,12 +467,12 @@ tests: date: '2015-12-26' regions: ["au_nt"] expect: - name: 'Boxing Day' + holiday: false - given: date: '2016-12-27' regions: ["au_sa"] expect: - name: 'Additional public holiday for Christmas Day' + name: 'Proclamation Day' - given: date: '2016-12-25' regions: ["au_nt"] @@ -519,22 +523,17 @@ tests: date: '2014-11-04' regions: ["au_vic_melbourne"] expect: - holiday: false + name: 'Melbourne Cup Day' - given: date: '2015-11-03' regions: ["au_vic_melbourne"] expect: - holiday: false + name: 'Melbourne Cup Day' - given: date: '2019-11-05' regions: ["au_vic"] expect: - holiday: false - - given: - date: '2021-11-02' - regions: ["au_vic"] - expect: - holiday: false + name: 'Melbourne Cup Day' - given: date: '2015-10-02' regions: ["au_vic"] diff --git a/us.yaml b/us.yaml index 27dd0d1..1ecf7ad 100644 --- a/us.yaml +++ b/us.yaml @@ -926,7 +926,7 @@ tests: expect: holiday: false - given: - date: ['2021-12-24', '2022-12-26', '2027-12-24'] + date: ['2021-12-24', '2022-12-23', '2027-12-24'] regions: ["us"] options: ["observed"] expect: From e00bfe748e233596ca622324d2c0b0eb44cc98d0 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 3 Nov 2021 15:30:15 +0000 Subject: [PATCH 094/195] Update Definitions file --- gb.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gb.yaml b/gb.yaml index 20faba9..d38418f 100644 --- a/gb.yaml +++ b/gb.yaml @@ -51,8 +51,8 @@ months: week: -1 wday: 1 year_ranges: - - before: 2022 - - after: 2022 + - before: 2021 + - after: 2023 6: - name: Spring Bank Holiday regions: [gb] @@ -99,23 +99,23 @@ months: year_ranges: - after: 2007 12: - - name: Christmas Day + - name: Christmas Day regions: [gb] - mday: 25 + mday: 25 observed: to_monday_if_weekend(date) year_ranges: - - before: 2022 - - after: 2022 + - before: 2021 + - after: 2023 - name: Boxing Day regions: [gb] mday: 26 observed: to_weekday_if_boxing_weekend(date) year_ranges: - - before: 2022 - - after: 2022 + - before: 2021 + - after: 2023 - name: Christmas Day (substitute day) regions: [gb] - mday: 27 + mday: 27 year_ranges: - limited: [2022] - name: Boxing Day From f0eeb33f065d4b5b11697b5712d83e7b081231b1 Mon Sep 17 00:00:00 2001 From: Philip Fraser Date: Thu, 4 Nov 2021 09:09:25 +0100 Subject: [PATCH 095/195] Update gb.yaml --- gb.yaml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/gb.yaml b/gb.yaml index 20faba9..0ede1c9 100644 --- a/gb.yaml +++ b/gb.yaml @@ -51,8 +51,8 @@ months: week: -1 wday: 1 year_ranges: - - before: 2022 - - after: 2022 + - before: 2021 + - after: 2023 6: - name: Spring Bank Holiday regions: [gb] @@ -99,13 +99,13 @@ months: year_ranges: - after: 2007 12: - - name: Christmas Day + - name: Christmas Day regions: [gb] - mday: 25 + mday: 25 observed: to_monday_if_weekend(date) year_ranges: - - before: 2022 - - after: 2022 + - before: 2021 + - after: 2023 - name: Boxing Day regions: [gb] mday: 26 @@ -115,12 +115,7 @@ months: - after: 2022 - name: Christmas Day (substitute day) regions: [gb] - mday: 27 - year_ranges: - - limited: [2022] - - name: Boxing Day - regions: [gb] - mday: 26 + mday: 27 year_ranges: - limited: [2022] From 971d90707d13c9778ee1112d08a8348fb1725d5b Mon Sep 17 00:00:00 2001 From: Philip Fraser Date: Thu, 4 Nov 2021 10:02:29 +0100 Subject: [PATCH 096/195] fix boxing day for uk --- gb.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/gb.yaml b/gb.yaml index 0ede1c9..170dcf8 100644 --- a/gb.yaml +++ b/gb.yaml @@ -110,9 +110,6 @@ months: regions: [gb] mday: 26 observed: to_weekday_if_boxing_weekend(date) - year_ranges: - - before: 2022 - - after: 2022 - name: Christmas Day (substitute day) regions: [gb] mday: 27 From 7bb0b05299295ee96f332aeba6e4c9b7bf98eb6b Mon Sep 17 00:00:00 2001 From: Philip Fraser Date: Thu, 4 Nov 2021 10:17:14 +0100 Subject: [PATCH 097/195] Boxing day not pushed in uk 2022 --- gb.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gb.yaml b/gb.yaml index 170dcf8..59aee9f 100644 --- a/gb.yaml +++ b/gb.yaml @@ -110,11 +110,18 @@ months: regions: [gb] mday: 26 observed: to_weekday_if_boxing_weekend(date) + year_ranges: + - before: 2021 + - after: 2023 - name: Christmas Day (substitute day) regions: [gb] mday: 27 year_ranges: - limited: [2022] + - name: Boxing Day + regions: [gb] + mday: 26 + - limited: [2022] tests: - given: From 05b5b403c1c3c78cc0f3b113fe9af0897bc38768 Mon Sep 17 00:00:00 2001 From: Philip Fraser Date: Thu, 4 Nov 2021 10:31:46 +0100 Subject: [PATCH 098/195] oopsie --- gb.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/gb.yaml b/gb.yaml index 59aee9f..d38418f 100644 --- a/gb.yaml +++ b/gb.yaml @@ -121,6 +121,7 @@ months: - name: Boxing Day regions: [gb] mday: 26 + year_ranges: - limited: [2022] tests: From cc97f0102c99b111ec5ab9b4d8695264859e90e9 Mon Sep 17 00:00:00 2001 From: Philip Fraser Date: Thu, 4 Nov 2021 12:08:32 +0100 Subject: [PATCH 099/195] Revert US change --- us.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/us.yaml b/us.yaml index 1ecf7ad..0b0dbb6 100644 --- a/us.yaml +++ b/us.yaml @@ -10,8 +10,8 @@ # - Add missing tests and correct existing tests # - Add helpful comments # - Add a lot of used sources -# -# Changed: 2021-10-15 +# +# Changed: 2021-10-15 # - Updated Christmas to Weekday # # Common Sources: @@ -300,7 +300,7 @@ months: - name: Christmas Day regions: [us] mday: 25 - observed: to_weekday_if_weekend(date) + observed: to_monday_if_weekend(date) - name: Day after Christmas regions: [us_ar, us_nc, us_ok, us_sc, us_tn, us_tx] mday: 26 From 4ad3b8be9a11c45cc3ebf0fb0045feab384565cc Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 5 Nov 2021 08:57:43 +0000 Subject: [PATCH 100/195] Update gb.yaml --- gb.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gb.yaml b/gb.yaml index d38418f..eb81976 100644 --- a/gb.yaml +++ b/gb.yaml @@ -39,7 +39,7 @@ months: regions: [gb_nir] mday: 17 5: - - name: Early May bank holiday + - name: Early May Bank Holiday regions: [gb] week: 1 wday: 1 @@ -59,7 +59,7 @@ months: mday: 2 year_ranges: - limited: [2022] - - name: Platinum Jubilee bank holiday + - name: Platinum Jubilee Bank Holiday regions: [gb] mday: 3 year_ranges: @@ -136,7 +136,7 @@ tests: regions: ["gb"] options: ["informal"] expect: - name: "Early May bank holiday" + name: "Early May Bank Holiday" - given: date: '2008-05-26' regions: ["gb"] @@ -154,7 +154,7 @@ tests: regions: ["gb"] options: ["informal"] expect: - name: "Platinum Jubilee bank holiday" + name: "Platinum Jubilee Bank Holiday" - given: date: '2008-11-05' regions: ["gb"] From c2cffd649b1d6686a545343f37788607a6cc2529 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Tue, 9 Nov 2021 12:01:22 +1000 Subject: [PATCH 101/195] added new rules for SA christmas day, NT boxing day, and additional NYD holiday --- au.yaml | 62 +++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 8 deletions(-) diff --git a/au.yaml b/au.yaml index 5c23f48..b2e9de9 100644 --- a/au.yaml +++ b/au.yaml @@ -33,14 +33,17 @@ months: regions: [au_vic] function: afl_grand_final(year) 1: - - name: New Year's Day - regions: [au, au_nsw, au_vic, au_act, au_sa, au_wa, au_nt, au_qld] + - name: New Year's Day # All states except SA and TAS have an additional public holiday for New Year's Day + regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld] mday: 1 - observed: to_monday_if_weekend(date) - - name: New Year's Day - regions: [au_tas] + - name: New Year's Day # SA and TAS move New Year's Day to monday on the weekend + regions: [au, au_tas, au_sa] mday: 1 function: to_monday_if_weekend(date) + - name: Additional public holiday for New Year's Day # All states except SA and TAS have additional PH for New Year's Day + regions: [au_nsw, au_vic, au_act, au_sa, au_wa, au_nt, au_qld] + mday: 1 + function: additional_holiday_on_monday_if_on_weekend(date) - name: Australia Day regions: [au] mday: 26 @@ -167,15 +170,27 @@ months: week: 1 wday: 2 12: + - name: Christmas Day # CHRISTMAS DAY EXCLUDING SATURDAY FOR SA + regions: [au_sa] + mday: 25 + function: sa_christmas_exclude_saturday(date) - name: Christmas Day # CHRISTMAS DAY ACTUAL - Recognised by ALL states expect for NT - regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa, au_nt] + regions: [au_act, au_nsw, au_qld, au_tas, au_vic, au_wa, au_nt] mday: 25 + - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY TO MONDAY FOR NT - christmas day is always on monday before boxing day in NT + regions: [au_nt] + mday: 25 + function: additional_holiday_on_monday_if_on_weekend(date) - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY - Recognised by ALL states expect for NT - regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa, au_nt] + regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa] mday: 25 function: additional_holiday_if_on_weekend(date) + - name: Boxing Day # BOXING DAY NT SUBSTITUTE - NT substitutes boxing day in front of christmas day instead if on the weekend + regions: [au_nt] + mday: 26 + function: to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday(date) - name: Boxing Day # BOXING DAY ACTUAL - Recognised by ALL states expect for NT - regions: [au_act, au_nsw, au_qld, au_vic, au_wa, au_nt] + regions: [au_act, au_nsw, au_qld, au_vic, au_wa] mday: 26 - name: Additional public holiday Boxing Day # ADDITIONAL BOXING DAY - Recognised by ALL states expect for NT / TAS regions: [au_act, au_nsw, au_qld, au_vic, au_wa, au_nt] @@ -304,6 +319,27 @@ methods: else nil end + additional_holiday_on_monday_if_on_weekend: + # NT has additional christmas day on monday before boxing day if on the weekend instead of tuesday + # Also Additional new year's day is observed on monday if on the weekend + arguments: date + source: | + if [0,6].include?(date.wday) + date += 2 if date.wday == 6 + date += 1 if date.wday == 0 + date + else + nil + end + sa_christmas_exclude_saturday: + arguments: date + source: | + if date.wday == 6 + nil + else + date + end + tests: - given: @@ -732,6 +768,16 @@ tests: regions: ["au_sa"] expect: name: 'Christmas Day' + - given: + date: '2021-12-25' + regions: ["au_sa"] + expect: + holiday: false + - given: + date: '2022-12-25' + regions: ["au_sa"] + expect: + name: 'Christmas Day' - given: date: '2016-12-26' regions: ["au_sa"] From 9b4e59f0a3cb63c035d0980341c64ed1c8d94858 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Tue, 9 Nov 2021 12:22:42 +1000 Subject: [PATCH 102/195] added tests --- au.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/au.yaml b/au.yaml index b2e9de9..9d21a75 100644 --- a/au.yaml +++ b/au.yaml @@ -877,6 +877,16 @@ tests: regions: ["au_tas"] expect: name: "New Year's Day" + - given: + date: '2022-01-03' + regions: ["au_nsw, au_vic, au_act, au_sa, au_wa, au_nt, au_qld"] + expect: + name: "Additional public holiday for New Year's Day" + - given: + date: '2022-01-01' + regions: ["au_nsw, au_vic, au_act, au_sa, au_wa, au_nt, au_qld"] + expect: + name: "New Year's Day" - given: date: '2017-04-16' regions: ["au_qld"] From bb3fbada8c902932f8e9e354358d41ceaa603d49 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Tue, 9 Nov 2021 14:32:16 +1000 Subject: [PATCH 103/195] fixed NT boxing day --- au.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/au.yaml b/au.yaml index 9d21a75..a068281 100644 --- a/au.yaml +++ b/au.yaml @@ -339,6 +339,18 @@ methods: else date end + to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday: # NT has boxing day on tuesday if on monday instead + arguments: date + source: | + if date.wday == 6 + date += 2 + date + elsif [0,1].include?(date.wday) + date += 1 + date + else + date + end tests: From bacbb2762f36fe729734b54b0367f802b7a995af Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Tue, 9 Nov 2021 15:01:18 +1000 Subject: [PATCH 104/195] fixed SA and NT public holidays --- au.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/au.yaml b/au.yaml index 9d21a75..c3fe1c5 100644 --- a/au.yaml +++ b/au.yaml @@ -37,11 +37,11 @@ months: regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld] mday: 1 - name: New Year's Day # SA and TAS move New Year's Day to monday on the weekend - regions: [au, au_tas, au_sa] + regions: [au_tas, au_sa] mday: 1 function: to_monday_if_weekend(date) - name: Additional public holiday for New Year's Day # All states except SA and TAS have additional PH for New Year's Day - regions: [au_nsw, au_vic, au_act, au_sa, au_wa, au_nt, au_qld] + regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld] mday: 1 function: additional_holiday_on_monday_if_on_weekend(date) - name: Australia Day @@ -177,12 +177,12 @@ months: - name: Christmas Day # CHRISTMAS DAY ACTUAL - Recognised by ALL states expect for NT regions: [au_act, au_nsw, au_qld, au_tas, au_vic, au_wa, au_nt] mday: 25 - - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY TO MONDAY FOR NT - christmas day is always on monday before boxing day in NT - regions: [au_nt] + - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY TO MONDAY FOR NT/SA - christmas day is always on monday before boxing day in NT/SA + regions: [au_nt, au_sa] mday: 25 function: additional_holiday_on_monday_if_on_weekend(date) - - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY - Recognised by ALL states expect for NT - regions: [au_act, au_nsw, au_qld, au_sa, au_tas, au_vic, au_wa] + - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY - Recognised by ALL states expect for NT and SA + regions: [au_act, au_nsw, au_qld, au_tas, au_vic, au_wa] mday: 25 function: additional_holiday_if_on_weekend(date) - name: Boxing Day # BOXING DAY NT SUBSTITUTE - NT substitutes boxing day in front of christmas day instead if on the weekend From 8de1d6779aadcd2bc2db29494d3e438eb5252f50 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Tue, 9 Nov 2021 15:14:11 +1000 Subject: [PATCH 105/195] fixed SA and NT holidays --- au.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index c3fe1c5..2d49c6d 100644 --- a/au.yaml +++ b/au.yaml @@ -339,7 +339,18 @@ methods: else date end - + to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday: # NT has boxing day on tuesday if on monday instead + arguments: date + source: | + if date.wday == 6 + date += 2 + date + elsif [0,1].include?(date.wday) + date += 1 + date + else + date + end tests: - given: From bf9749629eb66f3006be1b41589b294eeba1230a Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Tue, 9 Nov 2021 15:35:25 +1000 Subject: [PATCH 106/195] fixed SA boxing day --- au.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/au.yaml b/au.yaml index 2d49c6d..100e508 100644 --- a/au.yaml +++ b/au.yaml @@ -185,8 +185,8 @@ months: regions: [au_act, au_nsw, au_qld, au_tas, au_vic, au_wa] mday: 25 function: additional_holiday_if_on_weekend(date) - - name: Boxing Day # BOXING DAY NT SUBSTITUTE - NT substitutes boxing day in front of christmas day instead if on the weekend - regions: [au_nt] + - name: Boxing Day # BOXING DAY NT/SA SUBSTITUTE - NT/SA substitutes boxing day in front of christmas day instead if on the weekend + regions: [au_nt, au_sa] mday: 26 function: to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday(date) - name: Boxing Day # BOXING DAY ACTUAL - Recognised by ALL states expect for NT @@ -197,7 +197,7 @@ months: mday: 26 function: additional_holiday_if_on_weekend(date) - name: Boxing Day # BOXING DAY OBSERVED - Only NT & TAS as they dont have an additional observed if on weekend - regions: [au_tas, au_sa] # SA to be moved to additional setup in 2021 (2020 has no additionals) + regions: [au_tas] # SA to be moved to additional setup in 2021 (2020 has no additionals) mday: 26 observed: to_tuesday_if_sunday_or_monday_if_saturday(date) - name: Proclamation Day From 703c03fb08182dc9460d3b53109a3443788b38fc Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Tue, 9 Nov 2021 16:15:48 +1000 Subject: [PATCH 107/195] fixed SA christmas --- au.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/au.yaml b/au.yaml index 100e508..b3d5f02 100644 --- a/au.yaml +++ b/au.yaml @@ -170,28 +170,28 @@ months: week: 1 wday: 2 12: - - name: Christmas Day # CHRISTMAS DAY EXCLUDING SATURDAY FOR SA + - name: Christmas Day # CHRISTMAS DAY STATIC EXCEPT SATURDAY - Excluding Saturday for SA regions: [au_sa] mday: 25 function: sa_christmas_exclude_saturday(date) - - name: Christmas Day # CHRISTMAS DAY ACTUAL - Recognised by ALL states expect for NT + - name: Christmas Day # CHRISTMAS DAY STATIC ACTUAL - Recognised by ALL states expect for NT regions: [au_act, au_nsw, au_qld, au_tas, au_vic, au_wa, au_nt] mday: 25 - - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY TO MONDAY FOR NT/SA - christmas day is always on monday before boxing day in NT/SA - regions: [au_nt, au_sa] - mday: 25 - function: additional_holiday_on_monday_if_on_weekend(date) - - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY - Recognised by ALL states expect for NT and SA + - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY - additional christmas day moves two days forward on the weekend, Recognised by ALL states expect for NT and SA regions: [au_act, au_nsw, au_qld, au_tas, au_vic, au_wa] mday: 25 function: additional_holiday_if_on_weekend(date) - - name: Boxing Day # BOXING DAY NT/SA SUBSTITUTE - NT/SA substitutes boxing day in front of christmas day instead if on the weekend + - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY TO MONDAY FOR NT/SA - additional christmas day on the weekend is always on monday before boxing day in NT/SA regions: [au_nt, au_sa] - mday: 26 - function: to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday(date) + mday: 25 + function: additional_holiday_on_monday_if_on_weekend(date) - name: Boxing Day # BOXING DAY ACTUAL - Recognised by ALL states expect for NT regions: [au_act, au_nsw, au_qld, au_vic, au_wa] mday: 26 + - name: Boxing Day # BOXING DAY NT/SA SUBSTITUTE - NT/SA substitutes boxing day to monday instead of tuesday + regions: [au_nt, au_sa] + mday: 26 + function: to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday(date) - name: Additional public holiday Boxing Day # ADDITIONAL BOXING DAY - Recognised by ALL states expect for NT / TAS regions: [au_act, au_nsw, au_qld, au_vic, au_wa, au_nt] mday: 26 From 79c986b64353bcdf144984d0c085dcbcc9037159 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Tue, 9 Nov 2021 16:32:02 +1000 Subject: [PATCH 108/195] fixed NT/SA boxing day --- au.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/au.yaml b/au.yaml index b3d5f02..d2a6fea 100644 --- a/au.yaml +++ b/au.yaml @@ -188,7 +188,7 @@ months: - name: Boxing Day # BOXING DAY ACTUAL - Recognised by ALL states expect for NT regions: [au_act, au_nsw, au_qld, au_vic, au_wa] mday: 26 - - name: Boxing Day # BOXING DAY NT/SA SUBSTITUTE - NT/SA substitutes boxing day to monday instead of tuesday + - name: Boxing Day # BOXING DAY NT/SA SUBSTITUTE - NT/SA substitutes boxing day to after christmas day even if it falls on Monday regions: [au_nt, au_sa] mday: 26 function: to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday(date) @@ -339,13 +339,13 @@ methods: else date end - to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday: # NT has boxing day on tuesday if on monday instead + to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday: # NT/SA has boxing day on tuesday if on monday instead arguments: date source: | - if date.wday == 6 + if [6,0].include?(date.wday) date += 2 date - elsif [0,1].include?(date.wday) + elsif date.wday == 1 date += 1 date else From 22fbfa948e729d37bceee754d12d6e96624ba5dc Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Wed, 10 Nov 2021 09:34:42 +1000 Subject: [PATCH 109/195] fixed boxing day again NT --- au.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/au.yaml b/au.yaml index d2a6fea..78d4a92 100644 --- a/au.yaml +++ b/au.yaml @@ -170,11 +170,11 @@ months: week: 1 wday: 2 12: - - name: Christmas Day # CHRISTMAS DAY STATIC EXCEPT SATURDAY - Excluding Saturday for SA + - name: Christmas Day # SA CHRISTMAS DAY STATIC EXCEPT SATURDAY - Excluding Saturday for SA regions: [au_sa] mday: 25 function: sa_christmas_exclude_saturday(date) - - name: Christmas Day # CHRISTMAS DAY STATIC ACTUAL - Recognised by ALL states expect for NT + - name: Christmas Day # CHRISTMAS DAY STATIC ACTUAL - Recognised by ALL states expect for SA regions: [au_act, au_nsw, au_qld, au_tas, au_vic, au_wa, au_nt] mday: 25 - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY - additional christmas day moves two days forward on the weekend, Recognised by ALL states expect for NT and SA @@ -185,7 +185,7 @@ months: regions: [au_nt, au_sa] mday: 25 function: additional_holiday_on_monday_if_on_weekend(date) - - name: Boxing Day # BOXING DAY ACTUAL - Recognised by ALL states expect for NT + - name: Boxing Day # BOXING DAY STATIC ACTUAL - Recognised by ALL states expect for NT/SA regions: [au_act, au_nsw, au_qld, au_vic, au_wa] mday: 26 - name: Boxing Day # BOXING DAY NT/SA SUBSTITUTE - NT/SA substitutes boxing day to after christmas day even if it falls on Monday @@ -193,7 +193,7 @@ months: mday: 26 function: to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday(date) - name: Additional public holiday Boxing Day # ADDITIONAL BOXING DAY - Recognised by ALL states expect for NT / TAS - regions: [au_act, au_nsw, au_qld, au_vic, au_wa, au_nt] + regions: [au_act, au_nsw, au_qld, au_vic, au_wa] mday: 26 function: additional_holiday_if_on_weekend(date) - name: Boxing Day # BOXING DAY OBSERVED - Only NT & TAS as they dont have an additional observed if on weekend From c00e63e12664fde07b56dc510771ae3ca7c553ae Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Wed, 10 Nov 2021 09:57:15 +1000 Subject: [PATCH 110/195] fixed SA christmas day --- au.yaml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/au.yaml b/au.yaml index 78d4a92..4a74b81 100644 --- a/au.yaml +++ b/au.yaml @@ -170,7 +170,7 @@ months: week: 1 wday: 2 12: - - name: Christmas Day # SA CHRISTMAS DAY STATIC EXCEPT SATURDAY - Excluding Saturday for SA + - name: Christmas Day # SA CHRISTMAS DAY STATIC EXCEPT SATURDAY - Excluding Saturday for SA, is moved to monday regions: [au_sa] mday: 25 function: sa_christmas_exclude_saturday(date) @@ -181,10 +181,14 @@ months: regions: [au_act, au_nsw, au_qld, au_tas, au_vic, au_wa] mday: 25 function: additional_holiday_if_on_weekend(date) - - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY TO MONDAY FOR NT/SA - additional christmas day on the weekend is always on monday before boxing day in NT/SA - regions: [au_nt, au_sa] + - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY TO MONDAY FOR NT - additional christmas day on the weekend is always on monday before boxing day in NT + regions: [au_nt] mday: 25 function: additional_holiday_on_monday_if_on_weekend(date) + - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY TO MONDAY FOR SA EXCEPT ON SATURDAY - additional christmas day for SA excludes saturday + regions: [au_sa] + mday: 25 + function: additional_holiday_on_monday_if_on_sunday(date) - name: Boxing Day # BOXING DAY STATIC ACTUAL - Recognised by ALL states expect for NT/SA regions: [au_act, au_nsw, au_qld, au_vic, au_wa] mday: 26 @@ -331,11 +335,22 @@ methods: else nil end + additional_holiday_on_monday_if_on_sunday: + # SA doesn't get an additional christmas day if it falls on a saturday + arguments: date + source: | + if date.wday == 0 + date += 1 + date + else + nil + end sa_christmas_exclude_saturday: arguments: date source: | if date.wday == 6 - nil + date += 2 + date else date end From 699a4f1807dfa5f5cf1dbbebc0f7a542d556d5e2 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Wed, 10 Nov 2021 10:33:26 +1000 Subject: [PATCH 111/195] fixed SA additional boxing day --- au.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/au.yaml b/au.yaml index 4a74b81..c99e594 100644 --- a/au.yaml +++ b/au.yaml @@ -192,12 +192,16 @@ months: - name: Boxing Day # BOXING DAY STATIC ACTUAL - Recognised by ALL states expect for NT/SA regions: [au_act, au_nsw, au_qld, au_vic, au_wa] mday: 26 - - name: Boxing Day # BOXING DAY NT/SA SUBSTITUTE - NT/SA substitutes boxing day to after christmas day even if it falls on Monday - regions: [au_nt, au_sa] + - name: Boxing Day # BOXING DAY NT SUBSTITUTE - NT substitutes boxing day to after christmas day even if it falls on Monday + regions: [au_nt] mday: 26 function: to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday(date) + - name: Boxing Day # BOXING DAY SA SUBSTITUTE - SA only substitutes Boxing Day if it falls on a Monday + regions: [au_sa] + mday: 26 + function: to_tuesday_if_monday(date) - name: Additional public holiday Boxing Day # ADDITIONAL BOXING DAY - Recognised by ALL states expect for NT / TAS - regions: [au_act, au_nsw, au_qld, au_vic, au_wa] + regions: [au_act, au_nsw, au_qld, au_vic, au_wa, au_sa] mday: 26 function: additional_holiday_if_on_weekend(date) - name: Boxing Day # BOXING DAY OBSERVED - Only NT & TAS as they dont have an additional observed if on weekend From ac616c3f9493800941585077e18321d7c5fdfb4a Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Wed, 10 Nov 2021 10:40:44 +1000 Subject: [PATCH 112/195] added method --- au.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/au.yaml b/au.yaml index c99e594..019196d 100644 --- a/au.yaml +++ b/au.yaml @@ -370,6 +370,15 @@ methods: else date end + to_tuesday_if_monday: # SA moves boxing day to after christmas day instead + arguments: date + source: | + if date.wday == 1 + date += 1 + date + else + date + end tests: - given: From e3eaa2068f5b8b51472f2df2d6ff0fa66825bd70 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Fri, 12 Nov 2021 11:00:54 +1000 Subject: [PATCH 113/195] added NYD back to AU region --- au.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index 019196d..587f189 100644 --- a/au.yaml +++ b/au.yaml @@ -37,7 +37,7 @@ months: regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld] mday: 1 - name: New Year's Day # SA and TAS move New Year's Day to monday on the weekend - regions: [au_tas, au_sa] + regions: [au, au_tas, au_sa] mday: 1 function: to_monday_if_weekend(date) - name: Additional public holiday for New Year's Day # All states except SA and TAS have additional PH for New Year's Day From 1132a544500fd58e90ad66e315f96d086ae2624d Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Wed, 17 Nov 2021 13:28:56 +1000 Subject: [PATCH 114/195] removed NYD from AU again --- au.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index 587f189..019196d 100644 --- a/au.yaml +++ b/au.yaml @@ -37,7 +37,7 @@ months: regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld] mday: 1 - name: New Year's Day # SA and TAS move New Year's Day to monday on the weekend - regions: [au, au_tas, au_sa] + regions: [au_tas, au_sa] mday: 1 function: to_monday_if_weekend(date) - name: Additional public holiday for New Year's Day # All states except SA and TAS have additional PH for New Year's Day From 0c8afbc0b5d0209fa6b1c63e1acf95c5afa79801 Mon Sep 17 00:00:00 2001 From: Jasper Irvine Date: Tue, 14 Dec 2021 13:38:41 +1000 Subject: [PATCH 115/195] nt now has additional public holiday for boxing day --- au.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/au.yaml b/au.yaml index 019196d..c32299e 100644 --- a/au.yaml +++ b/au.yaml @@ -192,16 +192,12 @@ months: - name: Boxing Day # BOXING DAY STATIC ACTUAL - Recognised by ALL states expect for NT/SA regions: [au_act, au_nsw, au_qld, au_vic, au_wa] mday: 26 - - name: Boxing Day # BOXING DAY NT SUBSTITUTE - NT substitutes boxing day to after christmas day even if it falls on Monday - regions: [au_nt] - mday: 26 - function: to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday(date) - name: Boxing Day # BOXING DAY SA SUBSTITUTE - SA only substitutes Boxing Day if it falls on a Monday - regions: [au_sa] + regions: [au_sa, au_nt] mday: 26 function: to_tuesday_if_monday(date) - name: Additional public holiday Boxing Day # ADDITIONAL BOXING DAY - Recognised by ALL states expect for NT / TAS - regions: [au_act, au_nsw, au_qld, au_vic, au_wa, au_sa] + regions: [au_act, au_nsw, au_qld, au_vic, au_wa, au_sa, au_nt] mday: 26 function: additional_holiday_if_on_weekend(date) - name: Boxing Day # BOXING DAY OBSERVED - Only NT & TAS as they dont have an additional observed if on weekend From 7291babe0a45cf6b4541d90163e3e8a1f590137f Mon Sep 17 00:00:00 2001 From: Alex Ghiculescu Date: Mon, 20 Dec 2021 14:18:20 -0600 Subject: [PATCH 116/195] Fix US holiday dates https://tandadocs.atlassian.net/browse/PFC-3782 --- us.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/us.yaml b/us.yaml index 0b0dbb6..eab79b3 100644 --- a/us.yaml +++ b/us.yaml @@ -300,7 +300,7 @@ months: - name: Christmas Day regions: [us] mday: 25 - observed: to_monday_if_weekend(date) + observed: to_weekday_if_weekend(date) - name: Day after Christmas regions: [us_ar, us_nc, us_ok, us_sc, us_tn, us_tx] mday: 26 @@ -921,12 +921,12 @@ tests: name: "Christmas Eve" - given: - date: ['2021-12-27', '2022-12-26', '2027-12-27'] + date: ['2021-12-27', '2022-12-23', '2027-12-27'] regions: ["us"] expect: holiday: false - given: - date: ['2021-12-24', '2022-12-23', '2027-12-24'] + date: ['2021-12-24', '2022-12-26', '2027-12-24'] regions: ["us"] options: ["observed"] expect: From d55e56704f1bd4de35bd35a0d7c085d599c306cb Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Wed, 22 Dec 2021 10:34:04 +1000 Subject: [PATCH 117/195] Add Matariki manual logic --- nz.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/nz.yaml b/nz.yaml index c9eae5a..b09aca2 100644 --- a/nz.yaml +++ b/nz.yaml @@ -66,6 +66,9 @@ months: regions: [nz] week: 1 wday: 1 + - name: Matariki Holiday + regions: [nz] + function: matariki_holiday(year) 9: - name: Dominion Day regions: [nz_sc] @@ -271,3 +274,28 @@ methods: arguments: date source: | date + 7 + matariki_holiday: + arguments: year + source: | + case year + when 2022 + Date.civil(2022, 6, 4, 5) + when 2023 + Date.civil(2023, 7, 3, 5) + when 2024 + Date.civil(2024, 6, 5, 5) + when 2025 + Date.civil(2025, 6, 4, 5) + when 2026 + Date.civil(2026, 7, 2, 5) + when 2027 + Date.civil(2027, 6, 4, 5) + when 2028 + Date.civil(2028, 7, 3, 5) + when 2029 + Date.civil(2029, 7, 2, 5) + when 2030 + Date.civil(2030, 6, 4, 5) + when 2031 + Date.civil(2031, 7, 2, 5) + end From 90bde273873c34b0bec012bb568ce3c0aa3e7cea Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Wed, 22 Dec 2021 12:59:30 +1000 Subject: [PATCH 118/195] Amend Matariki PH function --- nz.yaml | 62 +++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/nz.yaml b/nz.yaml index b09aca2..3b3f469 100644 --- a/nz.yaml +++ b/nz.yaml @@ -279,23 +279,65 @@ methods: source: | case year when 2022 - Date.civil(2022, 6, 4, 5) + Date.civil(2022, 6, 24) when 2023 - Date.civil(2023, 7, 3, 5) + Date.civil(2023, 7, 14) when 2024 - Date.civil(2024, 6, 5, 5) + Date.civil(2024, 6, 28) when 2025 - Date.civil(2025, 6, 4, 5) + Date.civil(2025, 6, 20) when 2026 - Date.civil(2026, 7, 2, 5) + Date.civil(2026, 7, 10) when 2027 - Date.civil(2027, 6, 4, 5) + Date.civil(2027, 6, 25) when 2028 - Date.civil(2028, 7, 3, 5) + Date.civil(2028, 7, 14) when 2029 - Date.civil(2029, 7, 2, 5) + Date.civil(2029, 7, 6) when 2030 - Date.civil(2030, 6, 4, 5) + Date.civil(2030, 6, 21) when 2031 - Date.civil(2031, 7, 2, 5) + Date.civil(2031, 7, 11) + when 2032 + Date.civil(2032, 7, 2) + when 2033 + Date.civil(2033, 6, 24) + when 2034 + Date.civil(2034, 7, 7) + when 2035 + Date.civil(2035, 6, 29) + when 2036 + Date.civil(2036, 7, 21) + when 2037 + Date.civil(2037, 7, 10) + when 2038 + Date.civil(2038, 6, 25) + when 2039 + Date.civil(2039, 7, 15) + when 2040 + Date.civil(2040, 7, 6) + when 2041 + Date.civil(2041, 7, 19) + when 2042 + Date.civil(2042, 7, 11) + when 2043 + Date.civil(2043, 7, 3) + when 2044 + Date.civil(2044, 6, 24) + when 2045 + Date.civil(2045, 7, 7) + when 2046 + Date.civil(2046, 6, 29) + when 2047 + Date.civil(2047, 7, 19) + when 2048 + Date.civil(2048, 7, 3) + when 2049 + Date.civil(2049, 6, 25) + when 2050 + Date.civil(2050, 7, 15) + when 2051 + Date.civil(2051, 6, 30) + when 2052 + Date.civil(2052, 6, 25) end From 4a9a07c1bfc5c507dcd3efeb8d70406014de4e25 Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Mon, 14 Mar 2022 10:45:06 +1000 Subject: [PATCH 119/195] WA gets Easter Sunday for 2022 onwards --- au.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/au.yaml b/au.yaml index c32299e..1b298d8 100644 --- a/au.yaml +++ b/au.yaml @@ -25,6 +25,11 @@ months: function: easter(year) year_ranges: - after: 2017 + - name: Easter Sunday + regions: [au_wa] + function: easter(year) + year_ranges: + - after: 2021 - name: Easter Monday regions: [au] function: easter(year) @@ -927,6 +932,11 @@ tests: regions: ["au_qld"] expect: name: "Easter Sunday" + - given: + date: '2022-04-17' + regions: ["au_wa"] + expect: + name: "Easter Sunday" - given: date: '2021-08-02' regions: ["au-nt"] From c91bd09101605015b3d117e0ae018dee8363b814 Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Mon, 4 Apr 2022 11:36:51 +1000 Subject: [PATCH 120/195] change au yaml for new easter sunday PH --- au.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/au.yaml b/au.yaml index 1b298d8..1e4c46f 100644 --- a/au.yaml +++ b/au.yaml @@ -30,6 +30,11 @@ months: function: easter(year) year_ranges: - after: 2021 + - name: Easter Sunday + regions: [au_nt] + function: easter(year) + year_ranges: + - limited: 2022 - name: Easter Monday regions: [au] function: easter(year) From 0e94c91927cb2419fbf1c25b775a41e4376cf120 Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Thu, 16 Jun 2022 11:44:55 +1000 Subject: [PATCH 121/195] add matariki PH to the second nz yaml --- nz2_calendar_dates.yaml | 73 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/nz2_calendar_dates.yaml b/nz2_calendar_dates.yaml index 7cebec9..87d91cf 100644 --- a/nz2_calendar_dates.yaml +++ b/nz2_calendar_dates.yaml @@ -33,6 +33,9 @@ months: regions: [nz2_calendar_dates] week: 1 wday: 1 + - name: Matariki Holiday + regions: [nz2_calendar_dates] + function: matariki_holiday(year) 10: - name: Labour Day regions: [nz2_calendar_dates] @@ -115,3 +118,73 @@ tests: regions: ["nz2_calendar_dates"] expect: name: "Waitangi Day" + +methods: + matariki_holiday: + arguments: year + source: | + case year + when 2022 + Date.civil(2022, 6, 24) + when 2023 + Date.civil(2023, 7, 14) + when 2024 + Date.civil(2024, 6, 28) + when 2025 + Date.civil(2025, 6, 20) + when 2026 + Date.civil(2026, 7, 10) + when 2027 + Date.civil(2027, 6, 25) + when 2028 + Date.civil(2028, 7, 14) + when 2029 + Date.civil(2029, 7, 6) + when 2030 + Date.civil(2030, 6, 21) + when 2031 + Date.civil(2031, 7, 11) + when 2032 + Date.civil(2032, 7, 2) + when 2033 + Date.civil(2033, 6, 24) + when 2034 + Date.civil(2034, 7, 7) + when 2035 + Date.civil(2035, 6, 29) + when 2036 + Date.civil(2036, 7, 21) + when 2037 + Date.civil(2037, 7, 10) + when 2038 + Date.civil(2038, 6, 25) + when 2039 + Date.civil(2039, 7, 15) + when 2040 + Date.civil(2040, 7, 6) + when 2041 + Date.civil(2041, 7, 19) + when 2042 + Date.civil(2042, 7, 11) + when 2043 + Date.civil(2043, 7, 3) + when 2044 + Date.civil(2044, 6, 24) + when 2045 + Date.civil(2045, 7, 7) + when 2046 + Date.civil(2046, 6, 29) + when 2047 + Date.civil(2047, 7, 19) + when 2048 + Date.civil(2048, 7, 3) + when 2049 + Date.civil(2049, 6, 25) + when 2050 + Date.civil(2050, 7, 15) + when 2051 + Date.civil(2051, 6, 30) + when 2052 + Date.civil(2052, 6, 25) + end + \ No newline at end of file From 0b27e7dfa2bb064510d8bc1e356e088d616f84a2 Mon Sep 17 00:00:00 2001 From: Owen Roth Date: Fri, 17 Jun 2022 11:01:57 -0500 Subject: [PATCH 122/195] added juneteenth --- us.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/us.yaml b/us.yaml index eab79b3..e66c66d 100644 --- a/us.yaml +++ b/us.yaml @@ -194,6 +194,9 @@ months: regions: [us_hi] observed: to_weekday_if_weekend(date) mday: 11 + - name: Juneteenth + regions: [us] + mday: 19 - name: Emancipation Day in Texas # fixed regions: [us_tx] mday: 19 From f8096256ce6fde685da52d99e7445f00c81ca47d Mon Sep 17 00:00:00 2001 From: Owen Roth Date: Fri, 17 Jun 2022 11:17:49 -0500 Subject: [PATCH 123/195] added holidays and tests --- us.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/us.yaml b/us.yaml index e66c66d..ef615ca 100644 --- a/us.yaml +++ b/us.yaml @@ -197,6 +197,10 @@ months: - name: Juneteenth regions: [us] mday: 19 + - name: Juneteenth (Holiday) + regions: [us] + mday: 19 + function: to_weekday_if_weekend(date) # Note: Always if Independence Day don't match - name: Emancipation Day in Texas # fixed regions: [us_tx] mday: 19 @@ -949,3 +953,14 @@ tests: regions: ["us_mi", "us_wi"] expect: name: "New Year's Eve" + + - given: + date: ["2022-06-19"] + regions: ["us"] + expect: + name: "Juneteenth" + - given: + date: ["2022-06-20"] + regions: ["us"] + expect: + name: "Juneteenth (Holiday)" From 94c218314069587f9be2c0bcceac27fd8f10d101 Mon Sep 17 00:00:00 2001 From: Owen Roth Date: Fri, 17 Jun 2022 11:30:41 -0500 Subject: [PATCH 124/195] add observed --- us.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/us.yaml b/us.yaml index ef615ca..bc6c4b6 100644 --- a/us.yaml +++ b/us.yaml @@ -197,10 +197,7 @@ months: - name: Juneteenth regions: [us] mday: 19 - - name: Juneteenth (Holiday) - regions: [us] - mday: 19 - function: to_weekday_if_weekend(date) # Note: Always if Independence Day don't match + observed: to_weekday_if_weekend(date) - name: Emancipation Day in Texas # fixed regions: [us_tx] mday: 19 @@ -962,5 +959,6 @@ tests: - given: date: ["2022-06-20"] regions: ["us"] + options: ["observed"] expect: - name: "Juneteenth (Holiday)" + name: "Juneteenth" From 6aff6a1feecd89735f8cf12d2911e918c68e7385 Mon Sep 17 00:00:00 2001 From: Owen Roth Date: Fri, 17 Jun 2022 11:47:00 -0500 Subject: [PATCH 125/195] updated us with upstream defs --- us.yaml | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/us.yaml b/us.yaml index bc6c4b6..2f8e3ba 100644 --- a/us.yaml +++ b/us.yaml @@ -11,9 +11,6 @@ # - Add helpful comments # - Add a lot of used sources # -# Changed: 2021-10-15 -# - Updated Christmas to Weekday -# # Common Sources: # - http://en.wikipedia.org/wiki/Public_holidays_of_the_United_States # - https://www.timeanddate.com/holidays/us/ @@ -67,7 +64,9 @@ # - http://www.kleiner-kalender.de/event/rosch-ha-schana/0651c.html # - http://www.kaldix.com/united-states/calendar/virginia/holidays/independence-day/year-2017/ # - https://publicholidays.us/independence-day/ + --- + months: 0: - name: Shrove Tuesday @@ -194,10 +193,12 @@ months: regions: [us_hi] observed: to_weekday_if_weekend(date) mday: 11 - - name: Juneteenth + - name: Juneteenth National Independence Day regions: [us] mday: 19 observed: to_weekday_if_weekend(date) + year_ranges: + from: 2021 - name: Emancipation Day in Texas # fixed regions: [us_tx] mday: 19 @@ -315,12 +316,12 @@ months: methods: christmas_eve_holiday: arguments: date - source: | + ruby: | beginning_of_month = Date.civil(date.year, date.month, 1) (date.saturday? || date.sunday?) ? date.downto(beginning_of_month).find {|d| d if d.wday == 5} : date rosh_hashanah: arguments: year - source: | + ruby: | rosh_hashanah_dates = { '2014' => Date.civil(2014, 9, 25), '2015' => Date.civil(2015, 9, 14), @@ -333,7 +334,7 @@ methods: rosh_hashanah_dates[year.to_s] yom_kippur: arguments: year - source: | + ruby: | yom_kippur_dates = { '2014' => Date.civil(2014, 10, 4), '2015' => Date.civil(2015, 9, 23), @@ -347,14 +348,14 @@ methods: georgia_state_holiday: # Monday before that holiday arguments: year, month - source: | + ruby: | beginning_of_month = Date.civil(year, month, 1) state_holiday = Date.civil(year, month, 26) state_holiday.downto(beginning_of_month).find {|date| date if date.wday == 1 } lee_jackson_day: # Friday before Martin Luther King, Jr. Day arguments: year, month - source: | + ruby: | day_of_holiday = Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, month, 3, 1) beginning_of_month = Date.civil(year, month, 1) king_day = Date.civil(year, month, day_of_holiday) @@ -362,16 +363,16 @@ methods: election_day: # Tuesday after the first Monday of November arguments: year - source: | + ruby: | Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 11, 1, 1) + 1 us_inauguration_day: # January 20, every fourth year, following Presidential election arguments: year - source: | + ruby: | year % 4 == 1 ? 20 : nil day_after_thanksgiving: arguments: year - source: | + ruby: | Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 11, 4, 4) + 1 tests: @@ -689,6 +690,18 @@ tests: regions: ["us_hi"] expect: name: "King Kamehameha I Day" + - given: + date: ['2021-06-19'] + regions: ["us"] + options: ["observed"] + expect: + holiday: false + - given: + date: ['2021-06-18'] + regions: ["us"] + options: ["observed"] + expect: + name: "Juneteenth National Independence Day" - given: date: ['2017-6-19'] regions: ["us_tx"] @@ -925,7 +938,7 @@ tests: name: "Christmas Eve" - given: - date: ['2021-12-27', '2022-12-23', '2027-12-27'] + date: ['2021-12-27', '2022-12-26', '2027-12-27'] regions: ["us"] expect: holiday: false @@ -949,16 +962,4 @@ tests: date: ['2017-12-31'] regions: ["us_mi", "us_wi"] expect: - name: "New Year's Eve" - - - given: - date: ["2022-06-19"] - regions: ["us"] - expect: - name: "Juneteenth" - - given: - date: ["2022-06-20"] - regions: ["us"] - options: ["observed"] - expect: - name: "Juneteenth" + name: "New Year's Eve" \ No newline at end of file From 2e32f0e09cd28a6cb46f7d324e1fa9fd6f8dc168 Mon Sep 17 00:00:00 2001 From: Owen Roth Date: Fri, 17 Jun 2022 15:32:21 -0500 Subject: [PATCH 126/195] added revert, then just added juneteenth --- us.yaml | 44 ++++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/us.yaml b/us.yaml index 2f8e3ba..9f8ce46 100644 --- a/us.yaml +++ b/us.yaml @@ -11,6 +11,9 @@ # - Add helpful comments # - Add a lot of used sources # +# Changed: 2021-10-15 +# - Updated Christmas to Weekday +# # Common Sources: # - http://en.wikipedia.org/wiki/Public_holidays_of_the_United_States # - https://www.timeanddate.com/holidays/us/ @@ -64,9 +67,7 @@ # - http://www.kleiner-kalender.de/event/rosch-ha-schana/0651c.html # - http://www.kaldix.com/united-states/calendar/virginia/holidays/independence-day/year-2017/ # - https://publicholidays.us/independence-day/ - --- - months: 0: - name: Shrove Tuesday @@ -197,8 +198,6 @@ months: regions: [us] mday: 19 observed: to_weekday_if_weekend(date) - year_ranges: - from: 2021 - name: Emancipation Day in Texas # fixed regions: [us_tx] mday: 19 @@ -316,12 +315,12 @@ months: methods: christmas_eve_holiday: arguments: date - ruby: | + source: | beginning_of_month = Date.civil(date.year, date.month, 1) (date.saturday? || date.sunday?) ? date.downto(beginning_of_month).find {|d| d if d.wday == 5} : date rosh_hashanah: arguments: year - ruby: | + source: | rosh_hashanah_dates = { '2014' => Date.civil(2014, 9, 25), '2015' => Date.civil(2015, 9, 14), @@ -334,7 +333,7 @@ methods: rosh_hashanah_dates[year.to_s] yom_kippur: arguments: year - ruby: | + source: | yom_kippur_dates = { '2014' => Date.civil(2014, 10, 4), '2015' => Date.civil(2015, 9, 23), @@ -348,14 +347,14 @@ methods: georgia_state_holiday: # Monday before that holiday arguments: year, month - ruby: | + source: | beginning_of_month = Date.civil(year, month, 1) state_holiday = Date.civil(year, month, 26) state_holiday.downto(beginning_of_month).find {|date| date if date.wday == 1 } lee_jackson_day: # Friday before Martin Luther King, Jr. Day arguments: year, month - ruby: | + source: | day_of_holiday = Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, month, 3, 1) beginning_of_month = Date.civil(year, month, 1) king_day = Date.civil(year, month, day_of_holiday) @@ -363,18 +362,17 @@ methods: election_day: # Tuesday after the first Monday of November arguments: year - ruby: | + source: | Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 11, 1, 1) + 1 us_inauguration_day: # January 20, every fourth year, following Presidential election arguments: year - ruby: | + source: | year % 4 == 1 ? 20 : nil day_after_thanksgiving: arguments: year - ruby: | + source: | Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 11, 4, 4) + 1 - tests: - given: date: ['2017-2-28', '2018-2-13', '2019-3-5'] @@ -690,18 +688,6 @@ tests: regions: ["us_hi"] expect: name: "King Kamehameha I Day" - - given: - date: ['2021-06-19'] - regions: ["us"] - options: ["observed"] - expect: - holiday: false - - given: - date: ['2021-06-18'] - regions: ["us"] - options: ["observed"] - expect: - name: "Juneteenth National Independence Day" - given: date: ['2017-6-19'] regions: ["us_tx"] @@ -713,6 +699,12 @@ tests: regions: ["us"] expect: holiday: false + - given: + date: ['2021-06-18'] + regions: ["us"] + options: ["observed"] + expect: + name: "Juneteenth National Independence Day" - given: date: ['2017-6-20', '2020-6-19', '2021-6-21'] regions: ["us_wv"] @@ -938,7 +930,7 @@ tests: name: "Christmas Eve" - given: - date: ['2021-12-27', '2022-12-26', '2027-12-27'] + date: ['2021-12-27', '2022-12-23', '2027-12-27'] regions: ["us"] expect: holiday: false From 095f29e4807876d0a1aca3104dca34291c79675c Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Thu, 25 Aug 2022 10:24:29 +1000 Subject: [PATCH 127/195] 2022 AFL grand final VIC --- au.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/au.yaml b/au.yaml index 1e4c46f..b6c40b8 100644 --- a/au.yaml +++ b/au.yaml @@ -180,6 +180,10 @@ months: week: 1 wday: 2 12: + - name: Christmas Eve + regions: [au_sa, au_nt, au_qld] + mday: 24 + function: christmas_eve_part_day - name: Christmas Day # SA CHRISTMAS DAY STATIC EXCEPT SATURDAY - Excluding Saturday for SA, is moved to monday regions: [au_sa] mday: 25 @@ -237,6 +241,8 @@ methods: Date.civil(2020, 10, 23) when 2021 Date.civil(2021, 9, 24) + when 2022 + Date.civil(2022, 9, 23) end qld_queens_bday_october: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates @@ -385,6 +391,11 @@ methods: else date end + christmas_eve_part_day: + source: | + 1800 till 1200 + end + tests: - given: @@ -650,6 +661,11 @@ tests: regions: ["au_vic"] expect: name: 'Friday before the AFL Grand Final' + - given: + date: '2022-09-23' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' - given: date: '2005-05-16' regions: ["au_sa"] From a6d79f9a0889ed9ab4ee58d9db31cd2772162413 Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Thu, 25 Aug 2022 10:30:44 +1000 Subject: [PATCH 128/195] pushed code from something I started accidentially --- au.yaml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/au.yaml b/au.yaml index b6c40b8..f451658 100644 --- a/au.yaml +++ b/au.yaml @@ -180,10 +180,6 @@ months: week: 1 wday: 2 12: - - name: Christmas Eve - regions: [au_sa, au_nt, au_qld] - mday: 24 - function: christmas_eve_part_day - name: Christmas Day # SA CHRISTMAS DAY STATIC EXCEPT SATURDAY - Excluding Saturday for SA, is moved to monday regions: [au_sa] mday: 25 @@ -391,12 +387,7 @@ methods: else date end - christmas_eve_part_day: - source: | - 1800 till 1200 - end - - + tests: - given: date: '2020-04-25' From 78356bd12625ac197ec270440f819587095da501 Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Thu, 25 Aug 2022 10:31:30 +1000 Subject: [PATCH 129/195] linting --- au.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/au.yaml b/au.yaml index f451658..2ba2f48 100644 --- a/au.yaml +++ b/au.yaml @@ -387,7 +387,6 @@ methods: else date end - tests: - given: date: '2020-04-25' From bb478bfd7d552bdf40d2016fe0294bed46dfd66c Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Thu, 25 Aug 2022 10:32:01 +1000 Subject: [PATCH 130/195] lint take 2 --- au.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/au.yaml b/au.yaml index 2ba2f48..f812be0 100644 --- a/au.yaml +++ b/au.yaml @@ -387,6 +387,7 @@ methods: else date end + tests: - given: date: '2020-04-25' From 39f4ee80a75c0f7b9864464fd5f7b4dab0f11dfa Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 30 Aug 2022 11:03:03 +0100 Subject: [PATCH 131/195] Fix MU bank hol --- mu.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mu.yaml b/mu.yaml index 9775263..84be244 100644 --- a/mu.yaml +++ b/mu.yaml @@ -31,12 +31,12 @@ months: regions: [mu] mday: 01 year_ranges: - - limited: [2022] + - limited: [2022] - name: Chinese Spring Festival regions: [mu] mday: 12 year_ranges: - - limited: [2021] + - limited: [2021] 3: - name: Maha Shivaratree regions: [mu] @@ -72,17 +72,17 @@ months: mday: 15 year_ranges: - limited: [2022] - - name: Ganesh Chaturthi - regions: [mu] - mday: 31 - year_ranges: - - limited: [2022] 9: - name: Ganesh Chaturthi regions: [mu] mday: 11 year_ranges: - limited: [2021] + - name: Ganesh Chaturthi + regions: [mu] + mday: 1 + year_ranges: + - limited: [2022] 11: - name: All Saints' Day regions: [mu] From da1a2aac2d08d636a37f7df017c7e1d7864c0b87 Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Mon, 12 Sep 2022 09:33:47 +1000 Subject: [PATCH 132/195] amend yaml to include PH for all locations --- au.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/au.yaml b/au.yaml index f812be0..a450987 100644 --- a/au.yaml +++ b/au.yaml @@ -151,6 +151,12 @@ months: wday: 1 year_ranges: - before: 2017 + - name: Day of mourning for Queen Elizabeth II + regions: [au, au_nsw, au_act, au_sa, au_tas, au_vic, au_wa, au_nt, au_qld] + week: 4 + wday: 4 + year_ranges: + - limited: 2022 10: - name: Labour Day regions: [au_act, au_nsw, au_sa] From 733e81b221708ee0837c519da1905da58aa4951f Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Mon, 12 Sep 2022 14:00:33 +1000 Subject: [PATCH 133/195] mourning day to NZ PH --- nz.yaml | 5 +++++ nz2_calendar_dates.yaml | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/nz.yaml b/nz.yaml index 3b3f469..39504fb 100644 --- a/nz.yaml +++ b/nz.yaml @@ -74,6 +74,11 @@ months: regions: [nz_sc] week: 4 wday: 1 + - name: Day of mourning for Queen Elizabeth II + regions: [nz] + mday: 26 + year_ranges: + - limited: 2022 10: - name: Hawke's bay Anniversary Day regions: [nz_hb] diff --git a/nz2_calendar_dates.yaml b/nz2_calendar_dates.yaml index 87d91cf..c721fb7 100644 --- a/nz2_calendar_dates.yaml +++ b/nz2_calendar_dates.yaml @@ -36,6 +36,12 @@ months: - name: Matariki Holiday regions: [nz2_calendar_dates] function: matariki_holiday(year) + 9: + - name: Day of mourning for Queen Elizabeth II + regions: [nz2_calendar_dates] + mday: 26 + year_ranges: + - limited: 2022 10: - name: Labour Day regions: [nz2_calendar_dates] From fdab9669a1296d6098461eb2b52af68cbf9f047e Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Mon, 12 Sep 2022 14:01:00 +1000 Subject: [PATCH 134/195] make aus mourning PH better --- au.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/au.yaml b/au.yaml index a450987..6f1b5b0 100644 --- a/au.yaml +++ b/au.yaml @@ -153,8 +153,7 @@ months: - before: 2017 - name: Day of mourning for Queen Elizabeth II regions: [au, au_nsw, au_act, au_sa, au_tas, au_vic, au_wa, au_nt, au_qld] - week: 4 - wday: 4 + mday: 22 year_ranges: - limited: 2022 10: From 33dc5d30bba3c7db2edbfce7d3e0fb327a8162a7 Mon Sep 17 00:00:00 2001 From: Dan <88717431+DanjChick68@users.noreply.github.com> Date: Mon, 12 Sep 2022 09:49:42 +0100 Subject: [PATCH 135/195] Add new Bank hol for UK --- gb.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gb.yaml b/gb.yaml index eb81976..698e7a2 100644 --- a/gb.yaml +++ b/gb.yaml @@ -80,6 +80,12 @@ months: regions: [gb_eng, gb_wls, gb_eaw, gb_nir, je, gb_jsy, gg, gb_gsy] week: -1 wday: 1 + 9: + - name: Bank Holiday for the State Funeral of Queen Elizabeth II + regions: [gb] + mday: 19 + year_ranges: + - limited: [2022] 11: - name: Guy Fawkes Day regions: [gb] From 37cbef2d600d0f1658f0d140f2a4a90f5148762e Mon Sep 17 00:00:00 2001 From: Dan <88717431+DanjChick68@users.noreply.github.com> Date: Mon, 12 Sep 2022 10:47:17 +0100 Subject: [PATCH 136/195] Remove whitespace --- gb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gb.yaml b/gb.yaml index 698e7a2..84a42bb 100644 --- a/gb.yaml +++ b/gb.yaml @@ -85,7 +85,7 @@ months: regions: [gb] mday: 19 year_ranges: - - limited: [2022] + - limited: [2022] 11: - name: Guy Fawkes Day regions: [gb] From 3ddb95ecb45b2cb665227abe09073769a78ca474 Mon Sep 17 00:00:00 2001 From: Dan <88717431+DanjChick68@users.noreply.github.com> Date: Tue, 13 Sep 2022 11:38:31 +0100 Subject: [PATCH 137/195] Remove new BH for UK --- gb.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/gb.yaml b/gb.yaml index 84a42bb..eb81976 100644 --- a/gb.yaml +++ b/gb.yaml @@ -80,12 +80,6 @@ months: regions: [gb_eng, gb_wls, gb_eaw, gb_nir, je, gb_jsy, gg, gb_gsy] week: -1 wday: 1 - 9: - - name: Bank Holiday for the State Funeral of Queen Elizabeth II - regions: [gb] - mday: 19 - year_ranges: - - limited: [2022] 11: - name: Guy Fawkes Day regions: [gb] From 02e7e966fc6d9b8f556d94b976d106cdc70d5593 Mon Sep 17 00:00:00 2001 From: beaugrzanich Date: Tue, 13 Sep 2022 18:22:52 -0500 Subject: [PATCH 138/195] Add file for Uruguay --- uy.yaml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 uy.yaml diff --git a/uy.yaml b/uy.yaml new file mode 100644 index 0000000..53f5f3e --- /dev/null +++ b/uy.yaml @@ -0,0 +1,54 @@ +# Uruguay holiday definitions for the Ruby Holiday gem. +# +# Updated: 2022-09-13. +# +# - Sourced from LATAM Office +--- +months: + 1: + - name: Año Nuevo + regions: [uy] + mday: 1 + 5: + - name: Dia Del Trabajador + regions: [uy] + mday: 1 + 7: + - name: Jura Constitución + regions: [uy] + mday: 18 + 8: + - name: Día Independencia + regions: [uy] + mday: 25 + 12: + - name: Navidad + regions: [uy] + mday: 25 + +tests: + - given: + date: '2012-01-01' + regions: ["uy"] + expect: + name: "Año Nuevo" + - given: + date: '2022-05-01' + regions: ["uy"] + expect: + name: 'Dia Del Trabajador' + - given: + date: '2023-07-18' + regions: ["uy"] + expect: + name: 'Jura Constitución' + - given: + date: '2023-08-25' + regions: ["uy"] + expect: + name: 'Día Independencia' + - given: + date: '2017-12-25' + regions: ["uy"] + expect: + name: 'Navidad' \ No newline at end of file From d694d3a5feed60c16d2c8554fabc6b0ba8ce38b0 Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Wed, 16 Nov 2022 22:35:10 +1000 Subject: [PATCH 139/195] ADD: additional days for weekend --- nf.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nf.yaml b/nf.yaml index 12fa0a4..53b3729 100644 --- a/nf.yaml +++ b/nf.yaml @@ -7,6 +7,7 @@ # - https://publicholidays.asia/norfolk-island/2019-dates/ # - https://publicholidays.asia/norfolk-island/2020-dates/ # - https://en.wikipedia.org/wiki/Public_holidays_in_Norfolk_Island +# - --- months: 0: @@ -22,6 +23,10 @@ months: - name: New Year's Day regions: [nf] mday: 1 + - name: (additional day New Year's Day) + regions: [nf] + mday: 1 + observed: to_monday_if_weekend(date) - name: Australia Day regions: [nf] mday: 26 @@ -30,6 +35,10 @@ months: - name: Foundation Day regions: [nf] mday: 6 + - name: (additional day Foundation Day) + regions: [nf] + mday: 6 + observed: to_monday_if_weekend(date) 4: - name: Anzac Day regions: [nf] @@ -50,7 +59,7 @@ months: 11: - name: Thanksgiving Day regions: [nf] - week: 4 + week: 5 wday: 3 12: - name: Christmas Day @@ -59,6 +68,9 @@ months: - name: Boxing Day regions: [nf] mday: 26 + - name: (additional day Boxing Day) + regions: [nf] + mday: 26 observed: to_monday_if_weekend(date) methods: From a0bcc4bb7f13c1ed53dc57c472771008844a2c5e Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Wed, 16 Nov 2022 23:59:03 +1000 Subject: [PATCH 140/195] FIX: Christmas day not boxing day for the extra --- nf.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nf.yaml b/nf.yaml index 53b3729..991aeba 100644 --- a/nf.yaml +++ b/nf.yaml @@ -65,13 +65,13 @@ months: - name: Christmas Day regions: [nf] mday: 25 - - name: Boxing Day + - name: (additional day Christmas Day) regions: [nf] - mday: 26 - - name: (additional day Boxing Day) + mday: 25 + observed: to_monday_if_weekend(date) + - name: Boxing Day regions: [nf] mday: 26 - observed: to_monday_if_weekend(date) methods: monday_after_second_saturday: From 262510a7f17859a92e58585842eb6b78c5969226 Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Thu, 17 Nov 2022 12:23:27 +1000 Subject: [PATCH 141/195] FIX: boxing day to tuesday if Sunday --- nf.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nf.yaml b/nf.yaml index 991aeba..069b064 100644 --- a/nf.yaml +++ b/nf.yaml @@ -72,6 +72,10 @@ months: - name: Boxing Day regions: [nf] mday: 26 + - name: (additional day Boxing Day) + regions: [nf] + mday: 26 + observed: to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday methods: monday_after_second_saturday: @@ -79,6 +83,18 @@ methods: source: | second_sat_in_jun = Date.civil(year, 6, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 6, 2, :saturday)) second_sat_in_jun + 2 + to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday: + arguments: date + source: | + if [6,0].include?(date.wday) + date += 2 + date + elsif date.wday == 1 + date += 1 + date + else + date + end tests: - given: From 260bd223103f7871b519787281324724132b82ae Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Thu, 17 Nov 2022 17:30:42 +1000 Subject: [PATCH 142/195] FIX: function not observed --- nf.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nf.yaml b/nf.yaml index 069b064..45f9e31 100644 --- a/nf.yaml +++ b/nf.yaml @@ -75,7 +75,7 @@ months: - name: (additional day Boxing Day) regions: [nf] mday: 26 - observed: to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday + function: to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday(date) methods: monday_after_second_saturday: From 051816c13a7e86d42642c6bd6da37933b626084d Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Thu, 17 Nov 2022 17:44:46 +1000 Subject: [PATCH 143/195] FIX: needs to be nil if not applicable --- nf.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nf.yaml b/nf.yaml index 45f9e31..e1b7aa3 100644 --- a/nf.yaml +++ b/nf.yaml @@ -93,7 +93,7 @@ methods: date += 1 date else - date + nil end tests: From 5c3f098ac6baad31a304d18e4717e27797211e00 Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Thu, 17 Nov 2022 17:56:47 +1000 Subject: [PATCH 144/195] FIX: remove extra boxing day and make xmas on tuesday if boxing day monday --- nf.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/nf.yaml b/nf.yaml index e1b7aa3..ed2a07d 100644 --- a/nf.yaml +++ b/nf.yaml @@ -68,14 +68,10 @@ months: - name: (additional day Christmas Day) regions: [nf] mday: 25 - observed: to_monday_if_weekend(date) + function: to_tuesday_if_sunday_or_monday(date) - name: Boxing Day regions: [nf] mday: 26 - - name: (additional day Boxing Day) - regions: [nf] - mday: 26 - function: to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday(date) methods: monday_after_second_saturday: @@ -83,7 +79,7 @@ methods: source: | second_sat_in_jun = Date.civil(year, 6, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 6, 2, :saturday)) second_sat_in_jun + 2 - to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday: + to_tuesday_if_sunday_or_monday: arguments: date source: | if [6,0].include?(date.wday) From 177f0a607abc3e05fbb30ce7272abc659b3651d9 Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Thu, 17 Nov 2022 18:07:43 +1000 Subject: [PATCH 145/195] FIX: no need for extra xmas here --- nf.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nf.yaml b/nf.yaml index ed2a07d..72adfdc 100644 --- a/nf.yaml +++ b/nf.yaml @@ -68,7 +68,7 @@ months: - name: (additional day Christmas Day) regions: [nf] mday: 25 - function: to_tuesday_if_sunday_or_monday(date) + function: to_tuesday_if_sunday(date) - name: Boxing Day regions: [nf] mday: 26 @@ -79,15 +79,12 @@ methods: source: | second_sat_in_jun = Date.civil(year, 6, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 6, 2, :saturday)) second_sat_in_jun + 2 - to_tuesday_if_sunday_or_monday: + to_tuesday_if_sunday: arguments: date source: | if [6,0].include?(date.wday) date += 2 date - elsif date.wday == 1 - date += 1 - date else nil end From bb07abe6bbcf6ea09b59070d6ced130b39da88db Mon Sep 17 00:00:00 2001 From: Dan <88717431+DanjChick68@users.noreply.github.com> Date: Tue, 29 Nov 2022 13:46:54 +0000 Subject: [PATCH 146/195] Update diwali date in mu.yaml --- mu.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mu.yaml b/mu.yaml index 84be244..4758af2 100644 --- a/mu.yaml +++ b/mu.yaml @@ -83,6 +83,12 @@ months: mday: 1 year_ranges: - limited: [2022] + 10: + - name: Diwali + regions: [mu] + mday: 24 + year_ranges: + - limited: [2022] 11: - name: All Saints' Day regions: [mu] @@ -97,11 +103,6 @@ months: mday: 4 year_ranges: - limited: [2021] - - name: Diwali - regions: [mu] - mday: 24 - year_ranges: - - limited: [2022] 12: - name: Christmas Day regions: [mu] From aa5f5206f801fba076c64ffca2406ef924072fd0 Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Fri, 2 Dec 2022 09:14:07 +1000 Subject: [PATCH 147/195] FIX: SA getting New Years day and the observed day --- au.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/au.yaml b/au.yaml index 6f1b5b0..b9ebf59 100644 --- a/au.yaml +++ b/au.yaml @@ -43,15 +43,15 @@ months: regions: [au_vic] function: afl_grand_final(year) 1: - - name: New Year's Day # All states except SA and TAS have an additional public holiday for New Year's Day - regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld] + - name: New Year's Day # All states except TAS have an additional public holiday for New Year's Day + regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld, au_sa] mday: 1 - - name: New Year's Day # SA and TAS move New Year's Day to monday on the weekend - regions: [au_tas, au_sa] + - name: New Year's Day # TAS move New Year's Day to monday on the weekend + regions: [au_tas] mday: 1 function: to_monday_if_weekend(date) - - name: Additional public holiday for New Year's Day # All states except SA and TAS have additional PH for New Year's Day - regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld] + - name: Additional public holiday for New Year's Day # All states except TAS have additional PH for New Year's Day + regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld, au_sa] mday: 1 function: additional_holiday_on_monday_if_on_weekend(date) - name: Australia Day From 96ae713eb966dd0e0221a38b56987b97d449d530 Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Fri, 2 Dec 2022 10:30:21 +1000 Subject: [PATCH 148/195] FIX: make SA only apply after 2022 --- au.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index b9ebf59..e4037a2 100644 --- a/au.yaml +++ b/au.yaml @@ -44,8 +44,13 @@ months: function: afl_grand_final(year) 1: - name: New Year's Day # All states except TAS have an additional public holiday for New Year's Day - regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld, au_sa] + regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld] + mday: 1 + - name: New Year's Day # SA only just get this now. Can delete after this year. + regions: [au_sa] mday: 1 + year_ranges: + - after: 2022 - name: New Year's Day # TAS move New Year's Day to monday on the weekend regions: [au_tas] mday: 1 From ac159d161694b9b609c4c7f389fe48b503c79d5a Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Fri, 2 Dec 2022 10:53:31 +1000 Subject: [PATCH 149/195] FIX: make 2023 because after is inclusive --- SYNTAX.md | 2 +- au.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SYNTAX.md b/SYNTAX.md index 3a4388a..48d6f43 100644 --- a/SYNTAX.md +++ b/SYNTAX.md @@ -103,7 +103,7 @@ Then the holiday will be returned. This is especially useful for holidays like " ### Year ranges -Certain holidays in various countries are only in effect during specific year ranges. For example, a new holiday might come into effect that is only valid after a specific year (say, 2017). +Certain holidays in various countries are only in effect during specific year ranges. For example, a new holiday might come into effect that is only valid after a specific year (say, 2017). After is inclusive, if you put after: 2017 it will apply on 2017 and after. To address this we have the ability to specify these 'year ranges' in the definition. The gem will then only return a match on a date that adheres to these rules. diff --git a/au.yaml b/au.yaml index e4037a2..4688feb 100644 --- a/au.yaml +++ b/au.yaml @@ -50,7 +50,7 @@ months: regions: [au_sa] mday: 1 year_ranges: - - after: 2022 + - after: 2023 - name: New Year's Day # TAS move New Year's Day to monday on the weekend regions: [au_tas] mday: 1 From adf90d62baedb0a51b3f0420ac80829634e309d9 Mon Sep 17 00:00:00 2001 From: Daniel Chick <88717431+DanjChick68@users.noreply.github.com> Date: Mon, 19 Dec 2022 15:30:24 +0000 Subject: [PATCH 150/195] Add St Brigids Day as Irish Bank holiday --- ie.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ie.yaml b/ie.yaml index 793ea3c..5223eef 100644 --- a/ie.yaml +++ b/ie.yaml @@ -17,6 +17,10 @@ months: regions: [ie] mday: 1 observed: to_monday_if_weekend(date) + 2: + - name: St Brigid's Day + regions: [ie] + mday: 6 3: - name: St. Patrick's Day regions: [ie] @@ -58,6 +62,11 @@ tests: regions: ["ie"] expect: name: "New Year's Day" + - given: + date: '2023-02-06' + regions: ["ie"] + expect: + name: "St Brigid's Day" - given: date: '2008-03-17' regions: ["ie"] From adbc6003f7191cb89e63200a78ab642a1e76d905 Mon Sep 17 00:00:00 2001 From: Daniel Chick <88717431+DanjChick68@users.noreply.github.com> Date: Wed, 21 Dec 2022 15:29:30 +0000 Subject: [PATCH 151/195] Remove 1st of Jan from ES PH --- es.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/es.yaml b/es.yaml index 4b55ced..80fc1fb 100644 --- a/es.yaml +++ b/es.yaml @@ -29,6 +29,8 @@ months: regions: [es] mday: 1 observed: to_monday_if_sunday(date) + year_ranges: + - before: 2023 - name: Día de Reyes regions: [es] mday: 6 From cbc575e3701592329f7a0f2176dbc6e9c5b69b72 Mon Sep 17 00:00:00 2001 From: Daniel Chick <88717431+DanjChick68@users.noreply.github.com> Date: Wed, 21 Dec 2022 16:32:32 +0000 Subject: [PATCH 152/195] Change year range for es bh --- es.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es.yaml b/es.yaml index 80fc1fb..f4323fa 100644 --- a/es.yaml +++ b/es.yaml @@ -30,7 +30,7 @@ months: mday: 1 observed: to_monday_if_sunday(date) year_ranges: - - before: 2023 + - before: 2022 - name: Día de Reyes regions: [es] mday: 6 From 2e8801f0cca06e3bf60d99c14d0ed62ec742f226 Mon Sep 17 00:00:00 2001 From: seanmichael07 Date: Fri, 23 Dec 2022 09:28:29 +1000 Subject: [PATCH 153/195] Correct public holiday for malaysais to be first monday of June --- my.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/my.yaml b/my.yaml index 8070828..048a220 100644 --- a/my.yaml +++ b/my.yaml @@ -22,7 +22,8 @@ months: 6: - name: Agong's Birthday regions: [my] - mday: 4 + week: 1 + wday: 1 observed: to_weekday_if_weekend(date) 8: - name: Independence Day From a32cc9be50699de57efd5e290f2562b6efd6395c Mon Sep 17 00:00:00 2001 From: Daniel Chick <88717431+DanjChick68@users.noreply.github.com> Date: Fri, 23 Dec 2022 10:54:43 +0000 Subject: [PATCH 154/195] Add Kings Coronation to UK BH 2023 --- gb.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gb.yaml b/gb.yaml index eb81976..38bfefd 100644 --- a/gb.yaml +++ b/gb.yaml @@ -43,6 +43,11 @@ months: regions: [gb] week: 1 wday: 1 + - name: Bank holiday for the coronation of King Charles III + regions: [gb] + mday: 8 + year_ranges: + - limited: [2023] - name: Liberation Day regions: [je, gb_jsy, gg, gb_gsy] mday: 9 From a3f7cb6690d971ddc13a39f7acf5a36370201dd1 Mon Sep 17 00:00:00 2001 From: mattkuras Date: Mon, 9 Jan 2023 14:51:03 -0300 Subject: [PATCH 155/195] add uruguay to index file --- index.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/index.yaml b/index.yaml index 35bd8a2..32ec64f 100644 --- a/index.yaml +++ b/index.yaml @@ -65,6 +65,7 @@ defs: US: ['us.yaml', 'north_america_informal.yaml'] United_Nations: ['united_nations.yaml'] UPS: ['ups.yaml'] + UY: ['uy.yaml'] ZA: ['za.yaml'] North_America: ['ca.yaml', 'mx.yaml', 'us.yaml', 'north_america_informal.yaml'] South_America: ['ar.yaml', 'br.yaml', 'cl.yaml', 'co.yaml', 'pe.yaml', 've.yaml'] From 661ea4f7a55c92f4977e1e2182bff129fbcb9a63 Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Fri, 10 Mar 2023 16:36:36 +1000 Subject: [PATCH 156/195] ADD: Easter Sunday for NT plus tests so it applies from 2023 and forward --- au.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/au.yaml b/au.yaml index 4688feb..30e3191 100644 --- a/au.yaml +++ b/au.yaml @@ -30,6 +30,11 @@ months: function: easter(year) year_ranges: - after: 2021 + - name: Easter Sunday + regions: [au_nt] + function: easter(year) + year_ranges: + - after: 2021 - name: Easter Sunday regions: [au_nt] function: easter(year) @@ -964,3 +969,13 @@ tests: regions: ["au-nt"] expect: name: "Picnic Day" + - given: + date: '2022-04-17' + regions: ["au-nt"] + expect: + holiday: false + - given: + date: '2023-04-09' + regions: ["au_nt"] + expect: + name: "Easter Sunday" From e7aa1bde83a55e2aa8fd28544090a514a1998ecb Mon Sep 17 00:00:00 2001 From: Ben Aitcheson Date: Fri, 10 Mar 2023 17:03:19 +1000 Subject: [PATCH 157/195] FIX: wrong year for NT Easter Sunday --- au.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index 30e3191..7f9ec60 100644 --- a/au.yaml +++ b/au.yaml @@ -34,7 +34,7 @@ months: regions: [au_nt] function: easter(year) year_ranges: - - after: 2021 + - after: 2022 - name: Easter Sunday regions: [au_nt] function: easter(year) From 5dc8f709ef65f647c7f678170e2fad4ec46522af Mon Sep 17 00:00:00 2001 From: Daniel Chick <88717431+DanjChick68@users.noreply.github.com> Date: Sun, 26 Mar 2023 15:49:00 +0100 Subject: [PATCH 158/195] Change Capitalization for NF comment --- nf.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nf.yaml b/nf.yaml index 72adfdc..83b595a 100644 --- a/nf.yaml +++ b/nf.yaml @@ -35,7 +35,7 @@ months: - name: Foundation Day regions: [nf] mday: 6 - - name: (additional day Foundation Day) + - name: (Additional day Foundation Day) regions: [nf] mday: 6 observed: to_monday_if_weekend(date) From aed262d6a8f14e2e07e48f2c700d89e5b43b57f0 Mon Sep 17 00:00:00 2001 From: Daniel Chick <88717431+DanjChick68@users.noreply.github.com> Date: Mon, 27 Mar 2023 08:29:53 +0100 Subject: [PATCH 159/195] Update nf.yaml --- nf.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nf.yaml b/nf.yaml index 83b595a..72adfdc 100644 --- a/nf.yaml +++ b/nf.yaml @@ -35,7 +35,7 @@ months: - name: Foundation Day regions: [nf] mday: 6 - - name: (Additional day Foundation Day) + - name: (additional day Foundation Day) regions: [nf] mday: 6 observed: to_monday_if_weekend(date) From 69dc547220749449668453c12795843d41cbd6e1 Mon Sep 17 00:00:00 2001 From: Leon Zheng Date: Tue, 13 Jun 2023 16:47:45 +1000 Subject: [PATCH 160/195] added king's bday --- au.yaml | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index 7f9ec60..d4cee2c 100644 --- a/au.yaml +++ b/au.yaml @@ -129,6 +129,14 @@ months: regions: [au_act, au_nsw, au_sa, au_tas, au_nt, au_vic] week: 2 wday: 1 + year_ranges: + - before: 2022 + - name: King's Birthday + regions: [au_act, au_nsw, au_sa, au_tas, au_nt, au_vic] + week: 2 + wday: 1 + year_ranges: + - after: 2023 - name: Queen's Birthday regions: [au_qld] function: qld_queens_birthday_june(year) @@ -155,6 +163,15 @@ months: regions: [au_wa] week: -1 wday: 1 + year_ranges: + - before: 2022 + - name: King's Birthday + regions: [au_wa] + week: -1 + wday: 1 + year_ranges: + - before: 2023 + - name: "Family & Community Day" regions: [au_act] week: -1 @@ -179,6 +196,10 @@ months: regions: [au_qld] function: qld_queens_bday_october(year) observed: to_monday_if_weekend(date) + - name: King's Birthday + regions: [au_qld] + function: qld_kings_bday_october(year) + observed: to_monday_if_weekend(date) - name: Royal Hobart Show regions: [au_tas_south] function: hobart_show_day(year) @@ -255,13 +276,24 @@ methods: when 2022 Date.civil(2022, 9, 23) end + qld_kings_bday_october: + # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates + # celebrated twice in 2012 + # in october again from 2016 + arguments: year + source: | + if year >= 2023 + Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 1, 1) + else + nil + end qld_queens_bday_october: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates # celebrated twice in 2012 # in october again from 2016 arguments: year source: | - if year >= 2016 + if year <= 2022 && year >= 2016 Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 1, 1) elsif year == 2012 1 @@ -464,11 +496,21 @@ tests: regions: ["au_qld"] expect: name: "Queen's Birthday" + - given: + date: ['2023-10-02',"2024-10-07"] + regions: ["au_qld"] + expect: + name: "King's Birthday" - given: date: ['2014-09-29', '2015-09-28', '2016-09-26'] regions: ["au_wa"] expect: name: "Queen's Birthday" + - given: + date: ['2023-09-25'] + regions: ["au_wa"] + expect: + name: "King's Birthday" - given: date: '2014-09-29' regions: ["au_act"] From 2a081df5951ef585ef2b4a891e7d9ba1fff31519 Mon Sep 17 00:00:00 2001 From: Zak Mohamed Date: Mon, 14 Aug 2023 13:08:24 +1000 Subject: [PATCH 161/195] Commit my afl ph changes --- .gitignore | 2 ++ au.yaml | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/.gitignore b/.gitignore index ea7bbe8..a16f1f3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ coverage/ Gemfile.lock tmp/ +.bundle/ +vendor/ \ No newline at end of file diff --git a/au.yaml b/au.yaml index d4cee2c..82d6af6 100644 --- a/au.yaml +++ b/au.yaml @@ -275,6 +275,12 @@ methods: Date.civil(2021, 9, 24) when 2022 Date.civil(2022, 9, 23) + when 2023 + Date.civil(2023, 9, 29) + when 2024 + Date.civil(2024, 9, 27) + when 2025 + Date.civil(2025, 9, 26) end qld_kings_bday_october: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates @@ -714,6 +720,21 @@ tests: regions: ["au_vic"] expect: name: 'Friday before the AFL Grand Final' + - given: + date: '2023-09-29' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' + - given: + date: '2024-09-27' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' + - given: + date: '2025-09-26' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' - given: date: '2005-05-16' regions: ["au_sa"] From 1a857731dc44f38cb009ef15998c693e68e05e85 Mon Sep 17 00:00:00 2001 From: Zak Mohamed Date: Tue, 15 Aug 2023 14:23:30 +1000 Subject: [PATCH 162/195] removed bundle, vendor files, and the gitignore for them --- .bundle/config | 2 ++ .gitignore | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 .bundle/config diff --git a/.bundle/config b/.bundle/config new file mode 100644 index 0000000..2369228 --- /dev/null +++ b/.bundle/config @@ -0,0 +1,2 @@ +--- +BUNDLE_PATH: "vendor/bundle" diff --git a/.gitignore b/.gitignore index a16f1f3..ea7bbe8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,3 @@ coverage/ Gemfile.lock tmp/ -.bundle/ -vendor/ \ No newline at end of file From 499e899c91d6186c114e3489d986d0a5e44b7c26 Mon Sep 17 00:00:00 2001 From: Zak Mohamed Date: Tue, 15 Aug 2023 14:39:47 +1000 Subject: [PATCH 163/195] removed unnecessary files --- .bundle/config | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .bundle/config diff --git a/.bundle/config b/.bundle/config deleted file mode 100644 index 2369228..0000000 --- a/.bundle/config +++ /dev/null @@ -1,2 +0,0 @@ ---- -BUNDLE_PATH: "vendor/bundle" From 3d81a2c75a32828bc3770dd46ed1e57eb5393284 Mon Sep 17 00:00:00 2001 From: DanjChick68 Date: Mon, 13 Nov 2023 13:20:43 +0000 Subject: [PATCH 164/195] Add Cyprus Bank Holidays to Definitions --- cy.yaml | 174 +++++++++++++++++++++++++++++++++++++++++++++++++++++ el.yaml | 16 +++++ index.yaml | 1 + 3 files changed, 191 insertions(+) create mode 100644 cy.yaml diff --git a/cy.yaml b/cy.yaml new file mode 100644 index 0000000..8db4362 --- /dev/null +++ b/cy.yaml @@ -0,0 +1,174 @@ +# Cyprus holiday definitions for the Ruby Holiday gem. +# +# Created: 2023-11-13. +# Sources: + # https://www.officeholidays.com/countries/cyprus/2023 + # https://www.officeholidays.com/countries/cyprus/2024 + # https://en.wikipedia.org/wiki/Public_holidays_in_Cyprus +--- +months: + 0: + - name: Μεγάλη Παρασκευή + regions: [cy] + function: orthodox_easter(year) + function_modifier: -2 + - name: Μεγάλο Σάββατο + regions: [cy] + function: orthodox_easter(year) + function_modifier: -1 + - name: Κυριακή του Πάσχα + regions: [cy] + function: orthodox_easter(year) + - name: Δευτέρα του Πάσχα + regions: [cy] + function: orthodox_easter(year) + function_modifier: 1 + - name: Καθαρά Δευτέρα + regions: [cy] + function: orthodox_easter(year) + function_modifier: -48 + - name: Αγίου Πνεύματος + regions: [cy] + function: orthodox_easter(year) + function_modifier: 50 + 1: + - name: Πρωτοχρονιά + regions: [cy] + mday: 1 + - name: Θεοφάνεια + regions: [cy] + mday: 6 + 3: + - name: Επέτειος της Επανάστασης του 1821 + regions: [cy] + mday: 25 + 4: + - name: Εθνική Ημέρα της Κύπρου + regions: [cy] + mday: 1 + 5: + - name: Πρωτομαγιά + regions: [cy] + mday: 1 + 8: + - name: Κοίμηση της Θεοτόκου + regions: [cy] + mday: 15 + 10: + - name: Ημέρα Ανεξαρτησίας + regions: [cy] + mday: 1 + - name: Επέτειος του Όχι + regions: [cy] + mday: 28 + 12: + - name: Χριστούγεννα + regions: [cy] + mday: 25 + - name: Ημέρα Πυγμαχίας + regions: [cy] + mday: 26 + +tests: + - given: + date: '2023-04-01' + regions: ["cy"] + options: ["informal"] + expect: + name: "Εθνική Ημέρα της Κύπρου" + - given: + date: '2023-10-01' + regions: ["cy"] + options: ["informal"] + expect: + name: "Ημέρα Ανεξαρτησίας" + - given: + date: '2011-01-01' + regions: ["cy"] + options: ["informal"] + expect: + name: "Πρωτοχρονιά" + - given: + date: '2011-01-06' + regions: ["cy"] + options: ["informal"] + expect: + name: "Θεοφάνεια" + - given: + date: '2011-04-22' + regions: ["cy"] + options: ["informal"] + expect: + name: "Μεγάλη Παρασκευή" + - given: + date: '1970-04-25' + regions: ["cy"] + options: ["informal"] + expect: + name: "Μεγάλο Σάββατο" + - given: + date: '1985-04-14' + regions: ["cy"] + options: ["informal"] + expect: + name: "Κυριακή του Πάσχα" + - given: + date: '2011-04-24' + regions: ["cy"] + options: ["informal"] + expect: + name: "Κυριακή του Πάσχα" + - given: + date: '2027-05-02' + regions: ["cy"] + options: ["informal"] + expect: + name: "Κυριακή του Πάσχα" + - given: + date: '2046-04-30' + regions: ["cy"] + options: ["informal"] + expect: + name: "Δευτέρα του Πάσχα" + - given: + date: '2011-05-01' + regions: ["cy"] + options: ["informal"] + expect: + name: "Πρωτομαγιά" + - given: + date: '2011-06-13' + regions: ["cy"] + options: ["informal"] + expect: + name: "Αγίου Πνεύματος" + - given: + date: '2012-06-04' + regions: ["cy"] + options: ["informal"] + expect: + name: "Αγίου Πνεύματος" + - given: + date: '2011-03-07' + regions: ["cy"] + options: ["informal"] + expect: + name: "Καθαρά Δευτέρα" + - given: + date: '2012-02-27' + regions: ["cy"] + options: ["informal"] + expect: + name: "Καθαρά Δευτέρα" + - given: + date: '2011-12-25' + regions: ["cy"] + options: ["informal"] + expect: + name: "Χριστούγεννα" + - given: + date: '2011-12-26' + regions: ["cy"] + options: ["informal"] + expect: + name: "Δεύτερη ημέρα των Χριστουγέννων" diff --git a/el.yaml b/el.yaml index 79b3066..d27fdb2 100644 --- a/el.yaml +++ b/el.yaml @@ -34,6 +34,10 @@ months: regions: [el] function: orthodox_easter(year) function_modifier: 50 + - name: Πεντηκοστή + regions: [el] + function: orthodox_easter(year) + function_modifier: 49 1: - name: Πρωτοχρονιά regions: [el] @@ -66,6 +70,18 @@ months: mday: 26 tests: + - given: + date: '2023-06-04' + regions: ["el"] + options: ["informal"] + expect: + name: "Πεντηκοστή" + - given: + date: '2024-06-23' + regions: ["el"] + options: ["informal"] + expect: + name: "Πεντηκοστή" - given: date: '2011-01-01' regions: ["el"] diff --git a/index.yaml b/index.yaml index 32ec64f..c951520 100644 --- a/index.yaml +++ b/index.yaml @@ -13,6 +13,7 @@ defs: CL: ['cl.yaml'] CO: ['co.yaml'] CR: ['cr.yaml'] + CY: ['cy.yaml'] CZ: ['cz.yaml'] DK: ['dk.yaml'] DE: ['de.yaml'] From 881109432b21a1b9ef03f4517828292b59558105 Mon Sep 17 00:00:00 2001 From: ScAziz Date: Thu, 18 Jan 2024 15:23:30 +0000 Subject: [PATCH 165/195] update mu public holidays --- mu.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/mu.yaml b/mu.yaml index 4758af2..66bbfbb 100644 --- a/mu.yaml +++ b/mu.yaml @@ -13,6 +13,11 @@ months: - name: New Year's Holiday regions: [mu] mday: 2 + - name: Thaipoosam Cavadee + regions: [mu] + mday: 25 + year_ranges: + - limited: [2024] - name: Thaipoosam Cavadee regions: [mu] mday: 28 @@ -27,6 +32,11 @@ months: - name: Abolition of Slavery regions: [mu] mday: 1 + - name: Chinese Spring Festival + regions: [mu] + mday: 10 + year_ranges: + - limited: [2024] - name: Chinese Spring Festival regions: [mu] mday: 01 @@ -38,6 +48,11 @@ months: year_ranges: - limited: [2021] 3: + - name: Maha Shivaratree + regions: [mu] + mday: 8 + year_ranges: + - limited: [2024] - name: Maha Shivaratree regions: [mu] mday: 1 @@ -52,6 +67,11 @@ months: regions: [mu] mday: 12 4: + - name: Ugaadi + regions: [mu] + mday: 9 + year_ranges: + - limited: [2024] - name: Ougadi regions: [mu] mday: 2 @@ -73,6 +93,11 @@ months: year_ranges: - limited: [2022] 9: + - name: Ganesh Chaturthi + regions: [mu] + mday: 8 + year_ranges: + - limited: [2024] - name: Ganesh Chaturthi regions: [mu] mday: 11 @@ -84,6 +109,11 @@ months: year_ranges: - limited: [2022] 10: + - name: Diwali + regions: [mu] + mday: 31 + year_ranges: + - limited: [2024] - name: Diwali regions: [mu] mday: 24 From eedd2c8f6514a26c033ebc5d10a8841951459785 Mon Sep 17 00:00:00 2001 From: ScAziz Date: Thu, 18 Jan 2024 15:34:55 +0000 Subject: [PATCH 166/195] remove-force-changes lol --- mu.yaml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/mu.yaml b/mu.yaml index 66bbfbb..4758af2 100644 --- a/mu.yaml +++ b/mu.yaml @@ -13,11 +13,6 @@ months: - name: New Year's Holiday regions: [mu] mday: 2 - - name: Thaipoosam Cavadee - regions: [mu] - mday: 25 - year_ranges: - - limited: [2024] - name: Thaipoosam Cavadee regions: [mu] mday: 28 @@ -32,11 +27,6 @@ months: - name: Abolition of Slavery regions: [mu] mday: 1 - - name: Chinese Spring Festival - regions: [mu] - mday: 10 - year_ranges: - - limited: [2024] - name: Chinese Spring Festival regions: [mu] mday: 01 @@ -48,11 +38,6 @@ months: year_ranges: - limited: [2021] 3: - - name: Maha Shivaratree - regions: [mu] - mday: 8 - year_ranges: - - limited: [2024] - name: Maha Shivaratree regions: [mu] mday: 1 @@ -67,11 +52,6 @@ months: regions: [mu] mday: 12 4: - - name: Ugaadi - regions: [mu] - mday: 9 - year_ranges: - - limited: [2024] - name: Ougadi regions: [mu] mday: 2 @@ -93,11 +73,6 @@ months: year_ranges: - limited: [2022] 9: - - name: Ganesh Chaturthi - regions: [mu] - mday: 8 - year_ranges: - - limited: [2024] - name: Ganesh Chaturthi regions: [mu] mday: 11 @@ -109,11 +84,6 @@ months: year_ranges: - limited: [2022] 10: - - name: Diwali - regions: [mu] - mday: 31 - year_ranges: - - limited: [2024] - name: Diwali regions: [mu] mday: 24 From 6753f8de31ead1c0ee1f5660b069a320bea2fe54 Mon Sep 17 00:00:00 2001 From: DanjChick68 Date: Thu, 18 Jan 2024 15:53:10 +0000 Subject: [PATCH 167/195] Fix MU Public Holidays --- mu.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/mu.yaml b/mu.yaml index 4758af2..36c8cdb 100644 --- a/mu.yaml +++ b/mu.yaml @@ -13,6 +13,11 @@ months: - name: New Year's Holiday regions: [mu] mday: 2 + - name: Thaipoosam Cavadee + regions: [mu] + mday: 25 + year_ranges: + - limited: [2024] - name: Thaipoosam Cavadee regions: [mu] mday: 28 @@ -27,6 +32,11 @@ months: - name: Abolition of Slavery regions: [mu] mday: 1 + - name: Chinese Spring Festival + regions: [mu] + mday: 10 + year_ranges: + - limited: [2024] - name: Chinese Spring Festival regions: [mu] mday: 01 @@ -38,6 +48,11 @@ months: year_ranges: - limited: [2021] 3: + - name: Maha Shivaratree + regions: [mu] + mday: 8 + year_ranges: + - limited: [2024] - name: Maha Shivaratree regions: [mu] mday: 1 @@ -52,6 +67,11 @@ months: regions: [mu] mday: 12 4: + - name: Ugaadi + regions: [mu] + mday: 9 + year_ranges: + - limited: [2024] - name: Ougadi regions: [mu] mday: 2 @@ -73,6 +93,11 @@ months: year_ranges: - limited: [2022] 9: + - name: Ganesh Chaturthi + regions: [mu] + mday: 8 + year_ranges: + - limited: [2024] - name: Ganesh Chaturthi regions: [mu] mday: 11 @@ -84,6 +109,11 @@ months: year_ranges: - limited: [2022] 10: + - name: Diwali + regions: [mu] + mday: 31 + year_ranges: + - limited: [2024] - name: Diwali regions: [mu] mday: 24 From 862e60560d22a311a9abf35ec2975f8df0bbb842 Mon Sep 17 00:00:00 2001 From: DanjChick68 Date: Fri, 9 Feb 2024 13:55:25 +0000 Subject: [PATCH 168/195] Update St Brigids Day IE Bank Holiday Date --- ie.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ie.yaml b/ie.yaml index 5223eef..c07315f 100644 --- a/ie.yaml +++ b/ie.yaml @@ -20,7 +20,7 @@ months: 2: - name: St Brigid's Day regions: [ie] - mday: 6 + mday: 5 3: - name: St. Patrick's Day regions: [ie] From e16813b812f65cd38ae169dec61770d2f84bb497 Mon Sep 17 00:00:00 2001 From: JAMES MOSS Date: Mon, 12 Feb 2024 10:52:31 +1000 Subject: [PATCH 169/195] Hotfix: Updated kings birthday --- au.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index 82d6af6..8adcaf0 100644 --- a/au.yaml +++ b/au.yaml @@ -170,7 +170,7 @@ months: week: -1 wday: 1 year_ranges: - - before: 2023 + - after: 2023 - name: "Family & Community Day" regions: [au_act] From 64bc616525eaf046a58895fca67ebcdd827c985f Mon Sep 17 00:00:00 2001 From: JAMES MOSS Date: Mon, 12 Feb 2024 15:06:36 +1000 Subject: [PATCH 170/195] Hotfix: created a 2024 exception --- au.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/au.yaml b/au.yaml index 8adcaf0..25c72f0 100644 --- a/au.yaml +++ b/au.yaml @@ -165,12 +165,17 @@ months: wday: 1 year_ranges: - before: 2022 + - name: King's Birthday + regions: [au_wa] + mday: 23 + year_ranges: + - limited: [2024] - name: King's Birthday regions: [au_wa] week: -1 wday: 1 year_ranges: - - after: 2023 + - after: 2025 - name: "Family & Community Day" regions: [au_act] @@ -513,7 +518,7 @@ tests: expect: name: "Queen's Birthday" - given: - date: ['2023-09-25'] + date: ['2024-09-23', '2025-09-30'] regions: ["au_wa"] expect: name: "King's Birthday" From 8a76cf3484a65e90b3dcef83ee98f73ba9e681c8 Mon Sep 17 00:00:00 2001 From: JAMES MOSS Date: Mon, 12 Feb 2024 15:25:36 +1000 Subject: [PATCH 171/195] hotfix: Removed a troublesome space --- au.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/au.yaml b/au.yaml index 25c72f0..71b44d0 100644 --- a/au.yaml +++ b/au.yaml @@ -176,7 +176,6 @@ months: wday: 1 year_ranges: - after: 2025 - - name: "Family & Community Day" regions: [au_act] week: -1 From d777cb4ba6de7ecc3c7ca9b677c76157dedd826d Mon Sep 17 00:00:00 2001 From: JAMES MOSS Date: Mon, 12 Feb 2024 16:00:55 +1000 Subject: [PATCH 172/195] hotfix: I had to know --- au.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/au.yaml b/au.yaml index 71b44d0..50aa456 100644 --- a/au.yaml +++ b/au.yaml @@ -169,7 +169,7 @@ months: regions: [au_wa] mday: 23 year_ranges: - - limited: [2024] + - limited: 2024 - name: King's Birthday regions: [au_wa] week: -1 @@ -517,7 +517,7 @@ tests: expect: name: "Queen's Birthday" - given: - date: ['2024-09-23', '2025-09-30'] + date: ['2025-09-30'] regions: ["au_wa"] expect: name: "King's Birthday" @@ -729,12 +729,12 @@ tests: regions: ["au_vic"] expect: name: 'Friday before the AFL Grand Final' - - given: + - given: date: '2024-09-27' regions: ["au_vic"] expect: name: 'Friday before the AFL Grand Final' - - given: + - given: date: '2025-09-26' regions: ["au_vic"] expect: From d03a143716915d8ad2139d2593a5eb35cf288459 Mon Sep 17 00:00:00 2001 From: JAMES MOSS Date: Mon, 12 Feb 2024 16:18:56 +1000 Subject: [PATCH 173/195] hotfix: trying something new --- au.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/au.yaml b/au.yaml index 50aa456..e21a954 100644 --- a/au.yaml +++ b/au.yaml @@ -165,17 +165,17 @@ months: wday: 1 year_ranges: - before: 2022 - - name: King's Birthday - regions: [au_wa] - mday: 23 - year_ranges: - - limited: 2024 - name: King's Birthday regions: [au_wa] week: -1 wday: 1 year_ranges: - after: 2025 + - name: King's Birthday + regions: [au_wa] + mday: 23 + year_ranges: + - limited: 2024 - name: "Family & Community Day" regions: [au_act] week: -1 From 417b47f37a482cea9801b0661f61c4c706e75a96 Mon Sep 17 00:00:00 2001 From: MossJTanda <158242583+MossJTanda@users.noreply.github.com> Date: Mon, 12 Feb 2024 16:27:02 +1000 Subject: [PATCH 174/195] Update au.yaml --- au.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index e21a954..8171876 100644 --- a/au.yaml +++ b/au.yaml @@ -517,7 +517,7 @@ tests: expect: name: "Queen's Birthday" - given: - date: ['2025-09-30'] + date: ['2024-09-23', '2025-09-30'] regions: ["au_wa"] expect: name: "King's Birthday" From 23e810fcaca0c237b42a8fcccaf5ebe909d33e67 Mon Sep 17 00:00:00 2001 From: JAMES MOSS Date: Mon, 12 Feb 2024 16:43:45 +1000 Subject: [PATCH 175/195] hotfix: added 2023 KB back --- au.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/au.yaml b/au.yaml index 8171876..1e2fd1f 100644 --- a/au.yaml +++ b/au.yaml @@ -167,10 +167,15 @@ months: - before: 2022 - name: King's Birthday regions: [au_wa] - week: -1 - wday: 1 + week: -1 + wday: 1 year_ranges: - after: 2025 + - name: King's Birthday + regions: [au_wa] + mday: 25 + year_ranges: + - limited: 2023 - name: King's Birthday regions: [au_wa] mday: 23 From e0748b9bc45f712524c3ce73cd81624f45185d4e Mon Sep 17 00:00:00 2001 From: JAMES MOSS Date: Mon, 12 Feb 2024 16:50:37 +1000 Subject: [PATCH 176/195] hotfix: added 2023 KB back --- au.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/au.yaml b/au.yaml index 1e2fd1f..d3625bd 100644 --- a/au.yaml +++ b/au.yaml @@ -167,8 +167,8 @@ months: - before: 2022 - name: King's Birthday regions: [au_wa] - week: -1 - wday: 1 + week: -1 + wday: 1 year_ranges: - after: 2025 - name: King's Birthday From 437157b2675bccb7b842c258601febf834c64916 Mon Sep 17 00:00:00 2001 From: JAMES MOSS Date: Mon, 12 Feb 2024 17:19:23 +1000 Subject: [PATCH 177/195] hotfix: added a test for 2023 --- au.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index d3625bd..2a3a3ae 100644 --- a/au.yaml +++ b/au.yaml @@ -522,7 +522,7 @@ tests: expect: name: "Queen's Birthday" - given: - date: ['2024-09-23', '2025-09-30'] + date: ['2023-09-25','2024-09-23', '2025-09-30'] regions: ["au_wa"] expect: name: "King's Birthday" From 9f139de3bd6a907a5a1f3db940aa1b1e3b665139 Mon Sep 17 00:00:00 2001 From: AxelTanda Date: Thu, 22 Feb 2024 15:16:33 +0000 Subject: [PATCH 178/195] add holidays --- sg.yaml | 253 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 239 insertions(+), 14 deletions(-) diff --git a/sg.yaml b/sg.yaml index c1e5b05..57c200e 100644 --- a/sg.yaml +++ b/sg.yaml @@ -2,9 +2,7 @@ # Days not included in the definitions (yet): # Vesak Day (falls on the first full moon in May) -# Lunar New Year (falls on the first day of the Lunar Calendar) # Hari Raya Puasa and Hari Raya Haji (based on moon sightings, Islamic Calendar) -# Deepavali (15th Day of September or October, based on the Hindu Calendar) # Source: # http://publicholidays.sg/ @@ -15,6 +13,31 @@ months: regions: [sg] function: easter(year) function_modifier: -2 + - name: Lunar New Year's Day + regions: [sg] + function: cn_new_lunar_day(year) + observed: to_monday_if_sunday(date) + - name: The second day of Lunar New Year + regions: [sg] + function: cn_new_lunar_day(year) + function_modifier: 1 + observed: to_monday_if_sunday(date) + - name: Deepavali + regions: [sg] + function: deepavali(year) + observed: to_monday_if_sunday(date) + - name: Hari Raya Puasa + regions: [sg] + function: hari_raya_puasa(year) + observed: to_monday_if_sunday(date) + - name: Hari Raya Haji + regions: [sg] + function: hari_raya_haji(year) + observed: to_monday_if_sunday(date) + - name: Vesak Day + regions: [sg] + function: vesak_day(year) + observed: to_monday_if_sunday(date) 1: - name: New Year's Day regions: [sg] @@ -44,6 +67,184 @@ months: mday: 25 observed: to_weekday_if_weekend(date) +methods: + cn_new_lunar_day: + arguments: year + source: | + month_day = case year + when 1930, 1949, 1987, 2025, 2063, 2082, 2101, 2112, 2131, 2150, 2207, 2245, 2253, 2283, 2321 + [1, 29] + when 1931, 1950, 1969, 1988, 2007, 2026, 2045, 2083, 2091, 2102, 2121, 2159, 2197, 2208, 2216, 2227, 2246, 2265, 2303, 2322, 2341, 2379 + [2, 17] + when 1932, 1951, 1970, 1989, 2027, 2046, 2114, 2179, 2198, 2209, 2247, 2266, 2304, 2323, 2342, 2361, 2399 + [2, 6] + when 1933, 2009, 2028, 2047, 2066, 2085, 2115, 2161, 2199, 2210, 2229, 2267, 2305, 2316, 2324, 2335, 2381 + [1, 26] + when 1934, 1953, 2037, 2048, 2067, 2086, 2105, 2116, 2181, 2189, 2211, 2257, 2268, 2306, 2325, 2336 + [2, 14] + when 1935, 1943, 1992, 2038, 2106, 2144, 2201, 2212, 2258, 2296, 2307, 2326, 2364 + [2, 4] + when 1936, 1955, 2001, 2039, 2058, 2088, 2107, 2164, 2183, 2221, 2259, 2278, 2308, 2327, 2373 + [1, 24] + when 1937, 1975, 2032, 2040, 2051, 2070, 2108, 2127, 2146, 2165, 2252, 2260, 2271, 2290, 2309, 2328, 2347, 2366 + [2, 11] + when 1938, 1957, 1976, 1995, 2014, 2033, 2071, 2109, 2128, 2185, 2272, 2291, 2329, 2348, 2367, 2386 + [1, 31] + when 1939, 1996, 2015, 2053, 2072, 2110, 2129, 2292, 2330, 2368, 2387 + [2, 19] + when 1940, 1959, 2016, 2035, 2081, 2130, 2149, 2187, 2206, 2225, 2236, 2255, 2312, 2350, 2358, 2369 + [2, 8] + when 1941, 1952, 1971, 1990, 2074, 2093, 2123, 2142, 2180, 2248, 2294, 2343, 2351, 2362 + [1, 27] + when 1942, 1961, 1972, 1991, 2056, 2075, 2094, 2124, 2143, 2200, 2276, 2295, 2344, 2363 + [2, 15] + when 1944, 1963, 1982, 2020, 2096, 2134, 2153, 2172, 2191, 2202, 2240, 2286, 2354, 2392 + [1, 25] + when 1945, 1964, 1983, 2010, 2029, 2162, 2192, 2230, 2249, 2317, 2382 + [2, 13] + when 1946, 2003, 2022, 2041, 2052, 2098, 2147, 2155, 2166, 2223, 2242, 2261, 2299, 2310, 2375, 2394 + [2, 1] + when 1947, 2004, 2042, 2050, 2080, 2118, 2137, 2194, 2270, 2289, 2300, 2338, 2376 + [1, 22] + when 1948, 1994, 2013, 2024, 2043, 2089, 2119, 2138, 2157, 2176, 2195, 2214, 2320, 2396 + [2, 10] + when 1954, 1973, 2011, 2057, 2068, 2087, 2125, 2163, 2231, 2277, 2288, 2345, 2383 + [2, 3] + when 1956, 2002, 2021, 2059, 2078, 2097, 2135, 2154, 2173, 2184, 2203, 2222, 2241, 2279, 2287, 2298, 2355, 2374, 2393 + [2, 12] + when 1958, 1977, 2034, 2140, 2178, 2235, 2254, 2273, 2311, 2349, 2360, 2398 + [2, 18] + when 1960, 1979, 1998, 2006, 2017, 2036, 2055, 2104, 2169, 2188, 2218, 2226, 2237, 2256, 2275, 2313, 2332, 2370, 2389 + [1, 28] + when 1962, 1981, 2000, 2019, 2065, 2076, 2084, 2095, 2133, 2152, 2171, 2190, 2220, 2239, 2285, 2315, 2334, 2353, 2372, 2391 + [2, 5] + when 1965, 1984, 2030, 2049, 2060, 2079, 2117, 2136, 2174, 2182, 2193, 2204, 2250, 2269, 2280, 2318, 2337, 2356 + [2, 2] + when 1966, 2023, 2061, 2099, 2186, 2262, 2281, 2357, 2395 + [1, 21] + when 1967, 1986, 2005, 2062, 2100, 2168, 2233, 2244, 2263, 2282, 2301, 2339, 2377, 2385, 2388 + [2, 9] + when 1968, 2044, 2090, 2120, 2139, 2158, 2177, 2196, 2215, 2234, 2264, 2302, 2340, 2359, 2378, 2397 + [1, 30] + when 1974, 1993, 2012, 2031, 2069, 2077, 2126, 2145, 2156, 2175, 2213, 2232, 2251, 2297, 2346, 2365, 2384 + [1, 23] + when 1978, 1997, 2008, 2054, 2073, 2092, 2103, 2111, 2122, 2141, 2160, 2217, 2228, 2274, 2293, 2331, 2380 + [2, 7] + when 1980, 1999, 2018, 2064, 2113, 2132, 2151, 2170, 2219, 2238, 2284, 2314, 2333, 2352, 2371, 2390 + [2, 16] + when 1985, 2148, 2167, 2205, 2224, 2243 + [2, 20] + when 2319 + [2, 21] + end + Date.civil(year, month_day[0], month_day[1]) + + deepavali: + arguments: year + source: | + month_day = case year + when 2020, 2077 + [11, 15] + when 2021, 2040, 2078 + [11, 4] + when 2022, 2041 + [10, 25] + when 2023, 2069 + [11, 13] + when 2024, 2043, 2062 + [11, 1] + when 2025, 2063 + [10, 21] + when 2026 + [11, 9] + when 2027, 2046, 2065 + [10, 29] + when 2028 + [10, 18] + when 2029, 2048, 2067 + [11, 6] + when 2030, 2049, 2068 + [10, 26] + when 2031, 2050 + [11, 14] + when 2032, 2051 + [11, 3] + when 2033, 2071 + [10, 23] + when 2034 + [11, 11] + when 2035 + [10, 31] + when 2036, 2047, 2066 + [10, 19] + when 2037, 2056 + [11, 7] + when 2038, 2057 + [10, 28] + when 2039, 2058 + [11, 16] + when 2042, 2061 + [11, 12] + when 2044, 2055, 2074 + [10, 20] + when 2045, 2064, 2075 + [11, 8] + when 2052 + [10, 22] + when 2053, 2072 + [11, 10] + when 2054, 2073 + [10, 30] + when 2059 + [11, 5] + when 2060, 2079 + [10, 24] + when 2070 + [11, 2] + when 2076 + [10, 27] + end + Date.civil(year, month_day[0], month_day[1]) + + hari_raya_haji: + arguments: year + source: | + month_day = case year + when 2024 + [06, 17] + when 2025 + [06, 06] + when 2026 + [05, 27] + end + Date.civil(year, month_day[0], month_day[1]) + + hari_raya_puasa: + arguments: year + source: | + month_day = case year + when 2024 + [04, 10] + when 2025 + [06, 31] + when 2026 + [03, 20] + end + Date.civil(year, month_day[0], month_day[1]) + + vasak_day: + arguments: year + source: | + month_day = case year + when 2024 + [05, 22] + when 2025 + [05, 12] + when 2026 + [05, 31] + end + Date.civil(year, month_day[0], month_day[1]) + tests: - given: date: '2014-01-01' @@ -51,18 +252,6 @@ tests: options: ["informal"] expect: name: "New Year's Day" - - given: - date: '2014-02-14' - regions: ["sg"] - options: ["informal"] - expect: - name: "Valentine's Day" - - given: - date: '2014-02-15' - regions: ["sg"] - options: ["informal"] - expect: - name: "Total Defence Day" - given: date: '2014-04-18' regions: ["sg"] @@ -87,3 +276,39 @@ tests: options: ["informal"] expect: name: "Christmas Day" + - given: + date: '2016-02-08' + regions: ["sg"] + options: ["observed"] + expect: + name: "Lunar New Year's Day" + - given: + date: '2016-02-09' + regions: ["sg"] + options: ["observed"] + expect: + name: "The second day of Lunar New Year" + - given: + date: '2077-11-15' + regions: ["sg"] + options: ["observed"] + expect: + name: "Deepavali" + - given: + date: '2025-06-06' + regions: ["sg"] + options: ["observed"] + expect: + name: "Hari Raya Haji" + - given: + date: '2025-03-31' + regions: ["sg"] + options: ["observed"] + expect: + name: "Hari Raya Puasa" + - given: + date: '2025-05-12' + regions: ["sg"] + options: ["observed"] + expect: + name: "Vesak Day" \ No newline at end of file From ee7bf7f4ac180f49e52af1135d210dc591bf09b5 Mon Sep 17 00:00:00 2001 From: AxelTanda Date: Thu, 22 Feb 2024 15:40:00 +0000 Subject: [PATCH 179/195] update comment --- sg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sg.yaml b/sg.yaml index 57c200e..a957fe6 100644 --- a/sg.yaml +++ b/sg.yaml @@ -1,6 +1,6 @@ # Singapore holiday definitions for the Holidays gem! -# Days not included in the definitions (yet): +# Included in definitions but only till 2026: # Vesak Day (falls on the first full moon in May) # Hari Raya Puasa and Hari Raya Haji (based on moon sightings, Islamic Calendar) From 4cfae52ab6c5cc91763a304f095834d4540712af Mon Sep 17 00:00:00 2001 From: AxelTanda Date: Fri, 23 Feb 2024 09:39:13 +0000 Subject: [PATCH 180/195] mispell --- sg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sg.yaml b/sg.yaml index a957fe6..386dfb8 100644 --- a/sg.yaml +++ b/sg.yaml @@ -232,7 +232,7 @@ methods: end Date.civil(year, month_day[0], month_day[1]) - vasak_day: + vesak_day: arguments: year source: | month_day = case year From 0969e0e4ecf4a5c6d99f78959de1247d4393e475 Mon Sep 17 00:00:00 2001 From: AxelTanda Date: Fri, 23 Feb 2024 09:49:20 +0000 Subject: [PATCH 181/195] spacing --- sg.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sg.yaml b/sg.yaml index 386dfb8..ef939a1 100644 --- a/sg.yaml +++ b/sg.yaml @@ -138,7 +138,6 @@ methods: [2, 21] end Date.civil(year, month_day[0], month_day[1]) - deepavali: arguments: year source: | @@ -205,7 +204,6 @@ methods: [10, 27] end Date.civil(year, month_day[0], month_day[1]) - hari_raya_haji: arguments: year source: | @@ -218,7 +216,6 @@ methods: [05, 27] end Date.civil(year, month_day[0], month_day[1]) - hari_raya_puasa: arguments: year source: | @@ -231,7 +228,6 @@ methods: [03, 20] end Date.civil(year, month_day[0], month_day[1]) - vesak_day: arguments: year source: | From 2e0e11afeaeef8bef1f08dcd9d710e60e95a9991 Mon Sep 17 00:00:00 2001 From: AxelTanda Date: Fri, 23 Feb 2024 11:46:04 +0000 Subject: [PATCH 182/195] wrong month --- sg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sg.yaml b/sg.yaml index ef939a1..e3ced33 100644 --- a/sg.yaml +++ b/sg.yaml @@ -223,7 +223,7 @@ methods: when 2024 [04, 10] when 2025 - [06, 31] + [03, 31] when 2026 [03, 20] end From 95807fe218301f31b37ee7b2af20d3b502fd7dfb Mon Sep 17 00:00:00 2001 From: AxelTanda Date: Fri, 23 Feb 2024 13:16:03 +0000 Subject: [PATCH 183/195] add 2023 to singapore holidays --- sg.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sg.yaml b/sg.yaml index e3ced33..93f25ed 100644 --- a/sg.yaml +++ b/sg.yaml @@ -208,6 +208,8 @@ methods: arguments: year source: | month_day = case year + when 2023 + [06. 29] when 2024 [06, 17] when 2025 @@ -220,6 +222,8 @@ methods: arguments: year source: | month_day = case year + when 2023 + [04, 22] when 2024 [04, 10] when 2025 @@ -232,8 +236,10 @@ methods: arguments: year source: | month_day = case year + when 2023 + [06, 02] when 2024 - [05, 22] + [05, 23] when 2025 [05, 12] when 2026 From a056a35f39b41733184d909218d06b66e505d060 Mon Sep 17 00:00:00 2001 From: AxelTanda Date: Fri, 23 Feb 2024 14:04:37 +0000 Subject: [PATCH 184/195] fix up grammar --- sg.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sg.yaml b/sg.yaml index 93f25ed..ee0bd13 100644 --- a/sg.yaml +++ b/sg.yaml @@ -209,7 +209,7 @@ methods: source: | month_day = case year when 2023 - [06. 29] + [06, 29] when 2024 [06, 17] when 2025 From ffa5a55e496e84b9156d64d06c9bc7b2c70f82be Mon Sep 17 00:00:00 2001 From: AxelTanda Date: Mon, 26 Feb 2024 10:01:06 +0000 Subject: [PATCH 185/195] go off ph.sg website --- sg.yaml | 66 ++++++--------------------------------------------------- 1 file changed, 7 insertions(+), 59 deletions(-) diff --git a/sg.yaml b/sg.yaml index ee0bd13..5fd7f0e 100644 --- a/sg.yaml +++ b/sg.yaml @@ -142,66 +142,14 @@ methods: arguments: year source: | month_day = case year - when 2020, 2077 - [11, 15] - when 2021, 2040, 2078 - [11, 4] - when 2022, 2041 - [10, 25] - when 2023, 2069 - [11, 13] - when 2024, 2043, 2062 - [11, 1] - when 2025, 2063 - [10, 21] - when 2026 - [11, 9] - when 2027, 2046, 2065 - [10, 29] - when 2028 - [10, 18] - when 2029, 2048, 2067 - [11, 6] - when 2030, 2049, 2068 - [10, 26] - when 2031, 2050 - [11, 14] - when 2032, 2051 - [11, 3] - when 2033, 2071 - [10, 23] - when 2034 - [11, 11] - when 2035 - [10, 31] - when 2036, 2047, 2066 - [10, 19] - when 2037, 2056 - [11, 7] - when 2038, 2057 - [10, 28] - when 2039, 2058 - [11, 16] - when 2042, 2061 + when 2023 [11, 12] - when 2044, 2055, 2074 + when 2024 + [10, 31] + when 2025 [10, 20] - when 2045, 2064, 2075 - [11, 8] - when 2052 - [10, 22] - when 2053, 2072 - [11, 10] - when 2054, 2073 - [10, 30] - when 2059 - [11, 5] - when 2060, 2079 - [10, 24] - when 2070 - [11, 2] - when 2076 - [10, 27] + when 2026 + [10, 08] end Date.civil(year, month_day[0], month_day[1]) hari_raya_haji: @@ -239,7 +187,7 @@ methods: when 2023 [06, 02] when 2024 - [05, 23] + [05, 22] when 2025 [05, 12] when 2026 From de510729f1691e7760fd6abd5022e6ae5039e28a Mon Sep 17 00:00:00 2001 From: AxelTanda Date: Mon, 26 Feb 2024 11:26:57 +0000 Subject: [PATCH 186/195] Invalid Octal digits --- sg.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sg.yaml b/sg.yaml index 5fd7f0e..19d60a2 100644 --- a/sg.yaml +++ b/sg.yaml @@ -149,7 +149,7 @@ methods: when 2025 [10, 20] when 2026 - [10, 08] + [10, 8] end Date.civil(year, month_day[0], month_day[1]) hari_raya_haji: @@ -161,7 +161,7 @@ methods: when 2024 [06, 17] when 2025 - [06, 06] + [06, 6] when 2026 [05, 27] end From 9dc3e45334faf430e85b50169f712cc82c24fb86 Mon Sep 17 00:00:00 2001 From: AxelTanda Date: Tue, 27 Feb 2024 14:02:05 +0000 Subject: [PATCH 187/195] return nil if no year --- sg.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sg.yaml b/sg.yaml index 19d60a2..2cb1995 100644 --- a/sg.yaml +++ b/sg.yaml @@ -137,7 +137,7 @@ methods: when 2319 [2, 21] end - Date.civil(year, month_day[0], month_day[1]) + Date.civil(year, month_day[0], month_day[1]) if month_day deepavali: arguments: year source: | @@ -151,7 +151,7 @@ methods: when 2026 [10, 8] end - Date.civil(year, month_day[0], month_day[1]) + Date.civil(year, month_day[0], month_day[1]) if month_day hari_raya_haji: arguments: year source: | @@ -165,7 +165,7 @@ methods: when 2026 [05, 27] end - Date.civil(year, month_day[0], month_day[1]) + Date.civil(year, month_day[0], month_day[1]) if month_day hari_raya_puasa: arguments: year source: | @@ -179,7 +179,7 @@ methods: when 2026 [03, 20] end - Date.civil(year, month_day[0], month_day[1]) + Date.civil(year, month_day[0], month_day[1]) if month_day vesak_day: arguments: year source: | @@ -193,7 +193,7 @@ methods: when 2026 [05, 31] end - Date.civil(year, month_day[0], month_day[1]) + Date.civil(year, month_day[0], month_day[1]) if month_day tests: - given: From d99b2847a688dd4ef999e95d22f9a0f7ebbc201b Mon Sep 17 00:00:00 2001 From: JAMES MOSS Date: Wed, 28 Feb 2024 14:25:20 +1000 Subject: [PATCH 188/195] Hotfix: Added easter sunday holiday for SA --- au.yaml | 495 +++++++++++++++++--------------------------------------- 1 file changed, 152 insertions(+), 343 deletions(-) diff --git a/au.yaml b/au.yaml index 2a3a3ae..d971604 100644 --- a/au.yaml +++ b/au.yaml @@ -1,11 +1,10 @@ # Australian holiday definitions for the Ruby Holiday gem. -# Updated: 2008-11-29. +# Updated: 2020-07-15 # Sources: # - http://en.wikipedia.org/wiki/Australian_public_holidays # - http://www.docep.wa.gov.au/lr/LabourRelations/Content/Wages%20and%20Conditions/Public%20Holidays/Public_Holidays.html # - http://www.wst.tas.gov.au/employment_info/public_holidays # - https://www.fairwork.gov.au/leave/public-holidays/list-of-public-holidays -# - http://www.business.vic.gov.au/victorian-public-holidays-and-daylight-saving/victorian-public-holidays --- months: 0: @@ -24,46 +23,25 @@ months: regions: [au_qld, au_act] function: easter(year) year_ranges: - - after: 2017 + from: 2017 - name: Easter Sunday - regions: [au_wa] - function: easter(year) - year_ranges: - - after: 2021 - - name: Easter Sunday - regions: [au_nt] - function: easter(year) - year_ranges: - - after: 2022 - - name: Easter Sunday - regions: [au_nt] + regions: [au_sa] function: easter(year) year_ranges: - - limited: 2022 + from: 2024 - name: Easter Monday regions: [au] function: easter(year) function_modifier: 1 - - name: Friday before the AFL Grand Final - regions: [au_vic] - function: afl_grand_final(year) 1: - - name: New Year's Day # All states except TAS have an additional public holiday for New Year's Day - regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld] - mday: 1 - - name: New Year's Day # SA only just get this now. Can delete after this year. - regions: [au_sa] + - name: New Year's Day + regions: [au, au_nsw, au_vic, au_act, au_sa, au_wa, au_nt, au_qld] mday: 1 - year_ranges: - - after: 2023 - - name: New Year's Day # TAS move New Year's Day to monday on the weekend + observed: to_monday_if_weekend(date) + - name: New Year's Day regions: [au_tas] mday: 1 function: to_monday_if_weekend(date) - - name: Additional public holiday for New Year's Day # All states except TAS have additional PH for New Year's Day - regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld, au_sa] - mday: 1 - function: additional_holiday_on_monday_if_on_weekend(date) - name: Australia Day regions: [au] mday: 26 @@ -94,17 +72,20 @@ months: week: 2 wday: 1 4: - - name: ANZAC Day # ANZAC DAY ACTUAL - regions: [au_nsw, au_sa, au_tas, au_vic, au_act, au_wa] + - name: ANZAC Day + regions: [au] mday: 25 - - name: ANZAC Day # ANZAC DAY OBSERVED - no additional recognised - regions: [au_nt, au_qld] + - name: ANZAC Day + regions: [au_nsw, au_qld, au_nt, au_act, au_sa, au_tas] mday: 25 - observed: to_monday_if_weekend(date) - - name: Additional public holiday for ANZAC Day # ADDITIONAL ANZAC DAY - regions: [au_sa, au_act, au_wa] + observed: to_monday_if_sunday(date) + - name: ANZAC Day + regions: [au_vic] mday: 25 - function: additional_anzac_on_monday_if_on_weekend(date) + - name: ANZAC Day + regions: [au_wa] + mday: 25 + observed: to_monday_if_weekend(date) 5: - name: Labour Day regions: [au_qld] @@ -116,12 +97,14 @@ months: - name: May Public Holiday regions: [au_sa] function: may_pub_hol_sa(year) - - name: ACT Reconciliation Day - regions: [au_act] + - name: Reconciliation Day mday: 27 - observed: to_next_monday(date) + regions: [au_act] + function: to_nearest_monday_after(date) + year_ranges: + from: 2018 6: - - name: Foundation Day + - name: Western Australia Day regions: [au_wa] week: 1 wday: 1 @@ -129,14 +112,6 @@ months: regions: [au_act, au_nsw, au_sa, au_tas, au_nt, au_vic] week: 2 wday: 1 - year_ranges: - - before: 2022 - - name: King's Birthday - regions: [au_act, au_nsw, au_sa, au_tas, au_nt, au_vic] - week: 2 - wday: 1 - year_ranges: - - after: 2023 - name: Queen's Birthday regions: [au_qld] function: qld_queens_birthday_june(year) @@ -152,47 +127,27 @@ months: 8: - name: Ekka regions: [au_qld_brisbane] - week: -3 - wday: 3 - - name: Picnic Day - regions: [au_nt] - wday: 1 - week: 1 + function: qld_brisbane_ekka_holiday(year) 9: - - name: Queen's Birthday - regions: [au_wa] - week: -1 - wday: 1 + - name: National Day of Mourning for Her Majesty Queen Elizabeth II + regions: [au] + mday: 22 year_ranges: - - before: 2022 - - name: King's Birthday + limited: [2022] + - name: Queen's Birthday regions: [au_wa] week: -1 wday: 1 - year_ranges: - - after: 2025 - - name: King's Birthday - regions: [au_wa] - mday: 25 - year_ranges: - - limited: 2023 - - name: King's Birthday - regions: [au_wa] - mday: 23 - year_ranges: - - limited: 2024 - name: "Family & Community Day" regions: [au_act] week: -1 wday: 1 year_ranges: - - before: 2017 - - name: Day of mourning for Queen Elizabeth II - regions: [au, au_nsw, au_act, au_sa, au_tas, au_vic, au_wa, au_nt, au_qld] - mday: 22 - year_ranges: - - limited: 2022 + until: 2017 10: + - name: Friday before the AFL Grand Final + regions: [au_vic] + function: afl_grand_final(year) - name: Labour Day regions: [au_act, au_nsw, au_sa] week: 1 @@ -205,10 +160,6 @@ months: regions: [au_qld] function: qld_queens_bday_october(year) observed: to_monday_if_weekend(date) - - name: King's Birthday - regions: [au_qld] - function: qld_kings_bday_october(year) - observed: to_monday_if_weekend(date) - name: Royal Hobart Show regions: [au_tas_south] function: hobart_show_day(year) @@ -221,52 +172,33 @@ months: wday: 1 week: 1 - name: Melbourne Cup Day - regions: [au_vic_melbourne, au_vic] + regions: [au_vic_melbourne] week: 1 wday: 2 12: - - name: Christmas Day # SA CHRISTMAS DAY STATIC EXCEPT SATURDAY - Excluding Saturday for SA, is moved to monday - regions: [au_sa] + - name: Christmas Day # CHRISTMAS DAY - All states except SA observe on 27th (and 25th) if 25th is a Sunday + regions: [au_qld, au_nsw, au_act, au_tas, au_wa, au_vic, au_nt] mday: 25 - function: sa_christmas_exclude_saturday(date) - - name: Christmas Day # CHRISTMAS DAY STATIC ACTUAL - Recognised by ALL states expect for SA - regions: [au_act, au_nsw, au_qld, au_tas, au_vic, au_wa, au_nt] - mday: 25 - - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY - additional christmas day moves two days forward on the weekend, Recognised by ALL states expect for NT and SA - regions: [au_act, au_nsw, au_qld, au_tas, au_vic, au_wa] - mday: 25 - function: additional_holiday_if_on_weekend(date) - - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY TO MONDAY FOR NT - additional christmas day on the weekend is always on monday before boxing day in NT - regions: [au_nt] - mday: 25 - function: additional_holiday_on_monday_if_on_weekend(date) - - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY TO MONDAY FOR SA EXCEPT ON SATURDAY - additional christmas day for SA excludes saturday - regions: [au_sa] - mday: 25 - function: additional_holiday_on_monday_if_on_sunday(date) - - name: Boxing Day # BOXING DAY STATIC ACTUAL - Recognised by ALL states expect for NT/SA - regions: [au_act, au_nsw, au_qld, au_vic, au_wa] - mday: 26 - - name: Boxing Day # BOXING DAY SA SUBSTITUTE - SA only substitutes Boxing Day if it falls on a Monday - regions: [au_sa, au_nt] - mday: 26 - function: to_tuesday_if_monday(date) - - name: Additional public holiday Boxing Day # ADDITIONAL BOXING DAY - Recognised by ALL states expect for NT / TAS - regions: [au_act, au_nsw, au_qld, au_vic, au_wa, au_sa, au_nt] - mday: 26 - function: additional_holiday_if_on_weekend(date) - - name: Boxing Day # BOXING DAY OBSERVED - Only NT & TAS as they dont have an additional observed if on weekend - regions: [au_tas] # SA to be moved to additional setup in 2021 (2020 has no additionals) + observed: to_tuesday_if_sunday_or_monday_if_saturday(date) + - name: Boxing Day + regions: [au_nsw, au_vic, au_qld, au_act, au_wa] mday: 26 observed: to_tuesday_if_sunday_or_monday_if_saturday(date) + - name: Boxing Day + regions: [au_tas, au_nt] + function: to_weekday_if_boxing_weekend_from_year(year) - name: Proclamation Day regions: [au_sa] function: to_weekday_if_boxing_weekend_from_year_or_to_tuesday_if_monday(year) + - name: Christmas Day # CHRISTMAS DAY - SA observes on 26th if 25th is a Sunday (Boxing Day goes to 27th) + regions: [au_sa] + mday: 25 + observed: to_monday_if_weekend(date) methods: afl_grand_final: arguments: year - source: | + ruby: | case year when 2015 Date.civil(2015, 10, 2) @@ -277,38 +209,17 @@ methods: when 2018 Date.civil(2018, 9, 28) when 2019 - Date.civil(2019, 9, 27) + Date.civil(2019,9, 27) when 2020 Date.civil(2020, 10, 23) - when 2021 - Date.civil(2021, 9, 24) - when 2022 - Date.civil(2022, 9, 23) - when 2023 - Date.civil(2023, 9, 29) - when 2024 - Date.civil(2024, 9, 27) - when 2025 - Date.civil(2025, 9, 26) - end - qld_kings_bday_october: - # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates - # celebrated twice in 2012 - # in october again from 2016 - arguments: year - source: | - if year >= 2023 - Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 1, 1) - else - nil end qld_queens_bday_october: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates # celebrated twice in 2012 # in october again from 2016 arguments: year - source: | - if year <= 2022 && year >= 2016 + ruby: | + if year >= 2016 Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 1, 1) elsif year == 2012 1 @@ -319,7 +230,7 @@ methods: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates # in june until 2015 arguments: year - source: | + ruby: | if year <= 2015 Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 6, 2, 1) end @@ -327,7 +238,7 @@ methods: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates # for 2013 to 2016 it was in October, otherwise it's in May arguments: year - source: | + ruby: | if year < 2013 || year >= 2016 Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 5, 1, 1) end @@ -335,7 +246,7 @@ methods: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates # for 2013 to 2016 it was in October, otherwise it's in May arguments: year - source: | + ruby: | if year >= 2013 && year < 2016 Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 1, 1) end @@ -343,20 +254,20 @@ methods: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates # G20 day in brisbane, in 2014, on november 14 arguments: year - source: | + ruby: | year == 2014 ? 14 : nil hobart_show_day: # http://worksafe.tas.gov.au/__data/assets/pdf_file/0008/287036/Public_Holidays_2014.pdf # The Thursday before the fourth Saturday in October. arguments: year - source: | + ruby: | fourth_sat_in_oct = Date.civil(year, 10, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 4, :saturday)) fourth_sat_in_oct - 2 # the thursday before march_pub_hol_sa: # http://www.safework.sa.gov.au/show_page.jsp?id=2483#.VQ9Mfmb8-8E # The Holidays Act 1910 provides for the third Monday in May to be a public holiday. Since 2006 this public holiday has been observed on the second Monday in March through the issuing of a special Proclamation by the Governor. arguments: year - source: | + ruby: | if year < 2006 nil else @@ -366,126 +277,65 @@ methods: # http://www.safework.sa.gov.au/show_page.jsp?id=2483#.VQ9Mfmb8-8E # The Holidays Act 1910 provides for the third Monday in May to be a public holiday. Since 2006 this public holiday has been observed on the second Monday in March through the issuing of a special Proclamation by the Governor. arguments: year - source: | + ruby: | if year >= 2006 nil else Date.civil(year, 5, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 5, :third, :monday)) end - additional_holiday_if_on_weekend: - # https://www.fairwork.gov.au/leave/public-holidays - # https://www.fairwork.gov.au/leave/public-holidays/list-of-public-holidays/list-of-public-holidays-2021 - # If Boxing Day/Christmas fall on a weekend (Saturday / Sunday), the public holiday rates will be paid on both the weekend date and the observed date (e. Monday / Tuesday) and the additional day will use the term 'Additional public holiday'. - arguments: date - source: | - if [0,6].include?(date.wday) - date += 2 - date - else - nil - end - additional_anzac_on_monday_if_on_weekend: - # https://www.fairwork.gov.au/leave/public-holidays - # https://www.fairwork.gov.au/leave/public-holidays/list-of-public-holidays/list-of-public-holidays-2021 - # SA and WA recognise additional anzac holidays on monday if on the weekend - arguments: date - source: | - if [0,6].include?(date.wday) - date += 2 if date.wday == 6 - date += 1 if date.wday == 0 - date - else - nil - end - additional_holiday_on_monday_if_on_weekend: - # NT has additional christmas day on monday before boxing day if on the weekend instead of tuesday - # Also Additional new year's day is observed on monday if on the weekend - arguments: date - source: | - if [0,6].include?(date.wday) - date += 2 if date.wday == 6 - date += 1 if date.wday == 0 - date - else - nil - end - additional_holiday_on_monday_if_on_sunday: - # SA doesn't get an additional christmas day if it falls on a saturday - arguments: date - source: | - if date.wday == 0 - date += 1 - date - else - nil - end - sa_christmas_exclude_saturday: - arguments: date - source: | - if date.wday == 6 - date += 2 - date - else - date - end - to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday: # NT/SA has boxing day on tuesday if on monday instead - arguments: date - source: | - if [6,0].include?(date.wday) - date += 2 - date - elsif date.wday == 1 - date += 1 - date + qld_brisbane_ekka_holiday: + # https://www.qld.gov.au/recreation/travel/holidays/public + # The Ekka holiday occurs on the Wednesday during the RNA Show perido, the RNA show occurs on the first Friday of August, unless that's prior to August 5, then it occurs on the second. + arguments: year + ruby: | + first_friday = Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 8, :first, :friday) + + if first_friday < 5 + second_friday = Date.civil(year, 8, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 8, :second, :friday)) + second_friday + 5 # The next Wednesday else - date + Date.civil(year, 8, first_friday) + 5 end - to_tuesday_if_monday: # SA moves boxing day to after christmas day instead + to_nearest_monday_after: arguments: date - source: | - if date.wday == 1 - date += 1 + ruby: | + case date.wday + when 6 + date += 2 + when 5 + date += 3 + when 4 + date += 4 + when 3 + date += 5 + when 2 + date += 6 + when 0 + date += 1 + end date - else - date - end tests: - given: - date: '2020-04-25' - regions: ["au_act"] + date: "2017-04-14" + regions: ["au"] expect: - name: 'ANZAC Day' - - given: - date: '2020-04-25' - regions: ["au_qld"] - expect: - name: 'ANZAC Day' - - given: - date: '2021-04-27' - regions: ["au_wa"] - expect: - name: 'Additional public holiday for ANZAC Day' + name: "Good Friday" - given: - date: '2021-12-25' - regions: ["au_qld"] - expect: - name: 'Christmas Day' - - given: - date: '2021-12-27' - regions: ["au_qld"] + date: "2017-04-15" + regions: ["au_nsw"] expect: - name: 'Additional public holiday for Christmas Day' + name: "Easter Saturday" - given: - date: '2021-12-26' - regions: ["au_qld"] + date: ['2010-4-4', "2017-04-16"] + regions: ["au_nsw"] expect: - name: 'Boxing Day' + name: "Easter Sunday" - given: - date: '2021-12-28' - regions: ["au_qld"] + date: ['2024-03-31'] + regions: ["au_sa"] expect: - name: 'Additional public holiday for Boxing Day' + name: "Easter Sunday" - given: date: '2013-10-07' regions: ["au_qld"] @@ -511,21 +361,11 @@ tests: regions: ["au_qld"] expect: name: "Queen's Birthday" - - given: - date: ['2023-10-02',"2024-10-07"] - regions: ["au_qld"] - expect: - name: "King's Birthday" - given: date: ['2014-09-29', '2015-09-28', '2016-09-26'] regions: ["au_wa"] expect: name: "Queen's Birthday" - - given: - date: ['2023-09-25','2024-09-23', '2025-09-30'] - regions: ["au_wa"] - expect: - name: "King's Birthday" - given: date: '2014-09-29' regions: ["au_act"] @@ -541,12 +381,6 @@ tests: regions: ["au_act"] expect: name: 'Family & Community Day' - - given: - date: ['2017-05-29', '2018-05-28', '2019-05-27', '2020-06-01'] - regions: ["au_act"] - options: ["observed"] - expect: - name: 'ACT Reconciliation Day' - given: date: '2014-01-26' regions: ["au_qld"] @@ -684,11 +518,6 @@ tests: regions: ["au_vic_melbourne"] expect: name: 'Melbourne Cup Day' - - given: - date: '2019-11-05' - regions: ["au_vic"] - expect: - name: 'Melbourne Cup Day' - given: date: '2015-10-02' regions: ["au_vic"] @@ -704,46 +533,6 @@ tests: regions: ["au_vic"] expect: name: 'Friday before the AFL Grand Final' - - given: - date: '2018-09-28' - regions: ["au_vic"] - expect: - name: 'Friday before the AFL Grand Final' - - given: - date: '2019-09-27' - regions: ["au_vic"] - expect: - name: 'Friday before the AFL Grand Final' - - given: - date: '2020-10-23' - regions: ["au_vic"] - expect: - name: 'Friday before the AFL Grand Final' - - given: - date: '2021-09-24' - regions: ["au_vic"] - expect: - name: 'Friday before the AFL Grand Final' - - given: - date: '2022-09-23' - regions: ["au_vic"] - expect: - name: 'Friday before the AFL Grand Final' - - given: - date: '2023-09-29' - regions: ["au_vic"] - expect: - name: 'Friday before the AFL Grand Final' - - given: - date: '2024-09-27' - regions: ["au_vic"] - expect: - name: 'Friday before the AFL Grand Final' - - given: - date: '2025-09-26' - regions: ["au_vic"] - expect: - name: 'Friday before the AFL Grand Final' - given: date: '2005-05-16' regions: ["au_sa"] @@ -791,11 +580,6 @@ tests: options: ["observed"] expect: name: "Boxing Day" - - given: - date: '2020-12-26' - regions: ["au_qld"] - expect: - name: "Additional public holiday for Boxing Day" - given: date: '2015-12-26' regions: ["au_sa"] @@ -907,16 +691,6 @@ tests: regions: ["au_sa"] expect: name: 'Christmas Day' - - given: - date: '2021-12-25' - regions: ["au_sa"] - expect: - holiday: false - - given: - date: '2022-12-25' - regions: ["au_sa"] - expect: - name: 'Christmas Day' - given: date: '2016-12-26' regions: ["au_sa"] @@ -1017,37 +791,72 @@ tests: expect: name: "New Year's Day" - given: - date: '2022-01-03' - regions: ["au_nsw, au_vic, au_act, au_sa, au_wa, au_nt, au_qld"] - expect: - name: "Additional public holiday for New Year's Day" - - given: - date: '2022-01-01' - regions: ["au_nsw, au_vic, au_act, au_sa, au_wa, au_nt, au_qld"] + date: '2016-03-27' + regions: ["au_qld"] expect: - name: "New Year's Day" + holiday: false - given: date: '2017-04-16' regions: ["au_qld"] expect: name: "Easter Sunday" - given: - date: '2022-04-17' - regions: ["au_wa"] + date: "2014-11-14" + regions: ["au_qld_brisbane"] expect: - name: "Easter Sunday" + name: "G20 Day" + - given: + date: '2021-04-26' + regions: ["au_vic"] + expect: + holiday: false + - given: + date: '2019-08-14' + regions: ["au_qld_brisbane"] + expect: + name: "Ekka" - given: - date: '2021-08-02' - regions: ["au-nt"] + date: '2022-08-10' + regions: ["au_qld_brisbane"] expect: - name: "Picnic Day" + name: "Ekka" - given: - date: '2022-04-17' - regions: ["au-nt"] + date: '2023-08-16' + regions: ["au_qld_brisbane"] + expect: + name: "Ekka" + - given: + date: '2024-08-14' + regions: ["au_qld_brisbane"] + expect: + name: "Ekka" + - given: + date: '2025-08-13' + regions: ["au_qld_brisbane"] + expect: + name: "Ekka" + - given: + date: '2022-09-22' + regions: ['au'] + expect: + name: "National Day of Mourning for Her Majesty Queen Elizabeth II" + - given: + date: '2023-09-22' + regions: ['au'] expect: holiday: false - given: - date: '2023-04-09' - regions: ["au_nt"] + date: '2021-09-22' + regions: ['au'] expect: - name: "Easter Sunday" + holiday: false + - given: + date: '2024-05-27' + regions: ['au_act'] + expect: + name: "Reconciliation Day" + - given: + date: '2025-06-02' + regions: ['au_act'] + expect: + name: "Reconciliation Day" From 2a4e0b7ff84f1f97d841029699e4bbf5f841e564 Mon Sep 17 00:00:00 2001 From: JAMES MOSS Date: Wed, 28 Feb 2024 14:31:28 +1000 Subject: [PATCH 189/195] Return to OG --- au.yaml | 495 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 343 insertions(+), 152 deletions(-) diff --git a/au.yaml b/au.yaml index d971604..2a3a3ae 100644 --- a/au.yaml +++ b/au.yaml @@ -1,10 +1,11 @@ # Australian holiday definitions for the Ruby Holiday gem. -# Updated: 2020-07-15 +# Updated: 2008-11-29. # Sources: # - http://en.wikipedia.org/wiki/Australian_public_holidays # - http://www.docep.wa.gov.au/lr/LabourRelations/Content/Wages%20and%20Conditions/Public%20Holidays/Public_Holidays.html # - http://www.wst.tas.gov.au/employment_info/public_holidays # - https://www.fairwork.gov.au/leave/public-holidays/list-of-public-holidays +# - http://www.business.vic.gov.au/victorian-public-holidays-and-daylight-saving/victorian-public-holidays --- months: 0: @@ -23,25 +24,46 @@ months: regions: [au_qld, au_act] function: easter(year) year_ranges: - from: 2017 + - after: 2017 - name: Easter Sunday - regions: [au_sa] + regions: [au_wa] + function: easter(year) + year_ranges: + - after: 2021 + - name: Easter Sunday + regions: [au_nt] + function: easter(year) + year_ranges: + - after: 2022 + - name: Easter Sunday + regions: [au_nt] function: easter(year) year_ranges: - from: 2024 + - limited: 2022 - name: Easter Monday regions: [au] function: easter(year) function_modifier: 1 + - name: Friday before the AFL Grand Final + regions: [au_vic] + function: afl_grand_final(year) 1: - - name: New Year's Day - regions: [au, au_nsw, au_vic, au_act, au_sa, au_wa, au_nt, au_qld] + - name: New Year's Day # All states except TAS have an additional public holiday for New Year's Day + regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld] mday: 1 - observed: to_monday_if_weekend(date) - - name: New Year's Day + - name: New Year's Day # SA only just get this now. Can delete after this year. + regions: [au_sa] + mday: 1 + year_ranges: + - after: 2023 + - name: New Year's Day # TAS move New Year's Day to monday on the weekend regions: [au_tas] mday: 1 function: to_monday_if_weekend(date) + - name: Additional public holiday for New Year's Day # All states except TAS have additional PH for New Year's Day + regions: [au_nsw, au_vic, au_act, au_wa, au_nt, au_qld, au_sa] + mday: 1 + function: additional_holiday_on_monday_if_on_weekend(date) - name: Australia Day regions: [au] mday: 26 @@ -72,20 +94,17 @@ months: week: 2 wday: 1 4: - - name: ANZAC Day - regions: [au] - mday: 25 - - name: ANZAC Day - regions: [au_nsw, au_qld, au_nt, au_act, au_sa, au_tas] - mday: 25 - observed: to_monday_if_sunday(date) - - name: ANZAC Day - regions: [au_vic] + - name: ANZAC Day # ANZAC DAY ACTUAL + regions: [au_nsw, au_sa, au_tas, au_vic, au_act, au_wa] mday: 25 - - name: ANZAC Day - regions: [au_wa] + - name: ANZAC Day # ANZAC DAY OBSERVED - no additional recognised + regions: [au_nt, au_qld] mday: 25 observed: to_monday_if_weekend(date) + - name: Additional public holiday for ANZAC Day # ADDITIONAL ANZAC DAY + regions: [au_sa, au_act, au_wa] + mday: 25 + function: additional_anzac_on_monday_if_on_weekend(date) 5: - name: Labour Day regions: [au_qld] @@ -97,14 +116,12 @@ months: - name: May Public Holiday regions: [au_sa] function: may_pub_hol_sa(year) - - name: Reconciliation Day - mday: 27 + - name: ACT Reconciliation Day regions: [au_act] - function: to_nearest_monday_after(date) - year_ranges: - from: 2018 + mday: 27 + observed: to_next_monday(date) 6: - - name: Western Australia Day + - name: Foundation Day regions: [au_wa] week: 1 wday: 1 @@ -112,6 +129,14 @@ months: regions: [au_act, au_nsw, au_sa, au_tas, au_nt, au_vic] week: 2 wday: 1 + year_ranges: + - before: 2022 + - name: King's Birthday + regions: [au_act, au_nsw, au_sa, au_tas, au_nt, au_vic] + week: 2 + wday: 1 + year_ranges: + - after: 2023 - name: Queen's Birthday regions: [au_qld] function: qld_queens_birthday_june(year) @@ -127,27 +152,47 @@ months: 8: - name: Ekka regions: [au_qld_brisbane] - function: qld_brisbane_ekka_holiday(year) + week: -3 + wday: 3 + - name: Picnic Day + regions: [au_nt] + wday: 1 + week: 1 9: - - name: National Day of Mourning for Her Majesty Queen Elizabeth II - regions: [au] - mday: 22 - year_ranges: - limited: [2022] - name: Queen's Birthday regions: [au_wa] week: -1 wday: 1 + year_ranges: + - before: 2022 + - name: King's Birthday + regions: [au_wa] + week: -1 + wday: 1 + year_ranges: + - after: 2025 + - name: King's Birthday + regions: [au_wa] + mday: 25 + year_ranges: + - limited: 2023 + - name: King's Birthday + regions: [au_wa] + mday: 23 + year_ranges: + - limited: 2024 - name: "Family & Community Day" regions: [au_act] week: -1 wday: 1 year_ranges: - until: 2017 + - before: 2017 + - name: Day of mourning for Queen Elizabeth II + regions: [au, au_nsw, au_act, au_sa, au_tas, au_vic, au_wa, au_nt, au_qld] + mday: 22 + year_ranges: + - limited: 2022 10: - - name: Friday before the AFL Grand Final - regions: [au_vic] - function: afl_grand_final(year) - name: Labour Day regions: [au_act, au_nsw, au_sa] week: 1 @@ -160,6 +205,10 @@ months: regions: [au_qld] function: qld_queens_bday_october(year) observed: to_monday_if_weekend(date) + - name: King's Birthday + regions: [au_qld] + function: qld_kings_bday_october(year) + observed: to_monday_if_weekend(date) - name: Royal Hobart Show regions: [au_tas_south] function: hobart_show_day(year) @@ -172,33 +221,52 @@ months: wday: 1 week: 1 - name: Melbourne Cup Day - regions: [au_vic_melbourne] + regions: [au_vic_melbourne, au_vic] week: 1 wday: 2 12: - - name: Christmas Day # CHRISTMAS DAY - All states except SA observe on 27th (and 25th) if 25th is a Sunday - regions: [au_qld, au_nsw, au_act, au_tas, au_wa, au_vic, au_nt] + - name: Christmas Day # SA CHRISTMAS DAY STATIC EXCEPT SATURDAY - Excluding Saturday for SA, is moved to monday + regions: [au_sa] mday: 25 - observed: to_tuesday_if_sunday_or_monday_if_saturday(date) - - name: Boxing Day - regions: [au_nsw, au_vic, au_qld, au_act, au_wa] + function: sa_christmas_exclude_saturday(date) + - name: Christmas Day # CHRISTMAS DAY STATIC ACTUAL - Recognised by ALL states expect for SA + regions: [au_act, au_nsw, au_qld, au_tas, au_vic, au_wa, au_nt] + mday: 25 + - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY - additional christmas day moves two days forward on the weekend, Recognised by ALL states expect for NT and SA + regions: [au_act, au_nsw, au_qld, au_tas, au_vic, au_wa] + mday: 25 + function: additional_holiday_if_on_weekend(date) + - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY TO MONDAY FOR NT - additional christmas day on the weekend is always on monday before boxing day in NT + regions: [au_nt] + mday: 25 + function: additional_holiday_on_monday_if_on_weekend(date) + - name: Additional public holiday for Christmas Day # ADDITIONAL CHRISTMAS DAY TO MONDAY FOR SA EXCEPT ON SATURDAY - additional christmas day for SA excludes saturday + regions: [au_sa] + mday: 25 + function: additional_holiday_on_monday_if_on_sunday(date) + - name: Boxing Day # BOXING DAY STATIC ACTUAL - Recognised by ALL states expect for NT/SA + regions: [au_act, au_nsw, au_qld, au_vic, au_wa] + mday: 26 + - name: Boxing Day # BOXING DAY SA SUBSTITUTE - SA only substitutes Boxing Day if it falls on a Monday + regions: [au_sa, au_nt] + mday: 26 + function: to_tuesday_if_monday(date) + - name: Additional public holiday Boxing Day # ADDITIONAL BOXING DAY - Recognised by ALL states expect for NT / TAS + regions: [au_act, au_nsw, au_qld, au_vic, au_wa, au_sa, au_nt] + mday: 26 + function: additional_holiday_if_on_weekend(date) + - name: Boxing Day # BOXING DAY OBSERVED - Only NT & TAS as they dont have an additional observed if on weekend + regions: [au_tas] # SA to be moved to additional setup in 2021 (2020 has no additionals) mday: 26 observed: to_tuesday_if_sunday_or_monday_if_saturday(date) - - name: Boxing Day - regions: [au_tas, au_nt] - function: to_weekday_if_boxing_weekend_from_year(year) - name: Proclamation Day regions: [au_sa] function: to_weekday_if_boxing_weekend_from_year_or_to_tuesday_if_monday(year) - - name: Christmas Day # CHRISTMAS DAY - SA observes on 26th if 25th is a Sunday (Boxing Day goes to 27th) - regions: [au_sa] - mday: 25 - observed: to_monday_if_weekend(date) methods: afl_grand_final: arguments: year - ruby: | + source: | case year when 2015 Date.civil(2015, 10, 2) @@ -209,17 +277,38 @@ methods: when 2018 Date.civil(2018, 9, 28) when 2019 - Date.civil(2019,9, 27) + Date.civil(2019, 9, 27) when 2020 Date.civil(2020, 10, 23) + when 2021 + Date.civil(2021, 9, 24) + when 2022 + Date.civil(2022, 9, 23) + when 2023 + Date.civil(2023, 9, 29) + when 2024 + Date.civil(2024, 9, 27) + when 2025 + Date.civil(2025, 9, 26) + end + qld_kings_bday_october: + # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates + # celebrated twice in 2012 + # in october again from 2016 + arguments: year + source: | + if year >= 2023 + Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 1, 1) + else + nil end qld_queens_bday_october: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates # celebrated twice in 2012 # in october again from 2016 arguments: year - ruby: | - if year >= 2016 + source: | + if year <= 2022 && year >= 2016 Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 1, 1) elsif year == 2012 1 @@ -230,7 +319,7 @@ methods: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates # in june until 2015 arguments: year - ruby: | + source: | if year <= 2015 Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 6, 2, 1) end @@ -238,7 +327,7 @@ methods: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates # for 2013 to 2016 it was in October, otherwise it's in May arguments: year - ruby: | + source: | if year < 2013 || year >= 2016 Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 5, 1, 1) end @@ -246,7 +335,7 @@ methods: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates # for 2013 to 2016 it was in October, otherwise it's in May arguments: year - ruby: | + source: | if year >= 2013 && year < 2016 Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 1, 1) end @@ -254,20 +343,20 @@ methods: # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates # G20 day in brisbane, in 2014, on november 14 arguments: year - ruby: | + source: | year == 2014 ? 14 : nil hobart_show_day: # http://worksafe.tas.gov.au/__data/assets/pdf_file/0008/287036/Public_Holidays_2014.pdf # The Thursday before the fourth Saturday in October. arguments: year - ruby: | + source: | fourth_sat_in_oct = Date.civil(year, 10, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 10, 4, :saturday)) fourth_sat_in_oct - 2 # the thursday before march_pub_hol_sa: # http://www.safework.sa.gov.au/show_page.jsp?id=2483#.VQ9Mfmb8-8E # The Holidays Act 1910 provides for the third Monday in May to be a public holiday. Since 2006 this public holiday has been observed on the second Monday in March through the issuing of a special Proclamation by the Governor. arguments: year - ruby: | + source: | if year < 2006 nil else @@ -277,65 +366,126 @@ methods: # http://www.safework.sa.gov.au/show_page.jsp?id=2483#.VQ9Mfmb8-8E # The Holidays Act 1910 provides for the third Monday in May to be a public holiday. Since 2006 this public holiday has been observed on the second Monday in March through the issuing of a special Proclamation by the Governor. arguments: year - ruby: | + source: | if year >= 2006 nil else Date.civil(year, 5, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 5, :third, :monday)) end - qld_brisbane_ekka_holiday: - # https://www.qld.gov.au/recreation/travel/holidays/public - # The Ekka holiday occurs on the Wednesday during the RNA Show perido, the RNA show occurs on the first Friday of August, unless that's prior to August 5, then it occurs on the second. - arguments: year - ruby: | - first_friday = Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 8, :first, :friday) - - if first_friday < 5 - second_friday = Date.civil(year, 8, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 8, :second, :friday)) - second_friday + 5 # The next Wednesday + additional_holiday_if_on_weekend: + # https://www.fairwork.gov.au/leave/public-holidays + # https://www.fairwork.gov.au/leave/public-holidays/list-of-public-holidays/list-of-public-holidays-2021 + # If Boxing Day/Christmas fall on a weekend (Saturday / Sunday), the public holiday rates will be paid on both the weekend date and the observed date (e. Monday / Tuesday) and the additional day will use the term 'Additional public holiday'. + arguments: date + source: | + if [0,6].include?(date.wday) + date += 2 + date + else + nil + end + additional_anzac_on_monday_if_on_weekend: + # https://www.fairwork.gov.au/leave/public-holidays + # https://www.fairwork.gov.au/leave/public-holidays/list-of-public-holidays/list-of-public-holidays-2021 + # SA and WA recognise additional anzac holidays on monday if on the weekend + arguments: date + source: | + if [0,6].include?(date.wday) + date += 2 if date.wday == 6 + date += 1 if date.wday == 0 + date + else + nil + end + additional_holiday_on_monday_if_on_weekend: + # NT has additional christmas day on monday before boxing day if on the weekend instead of tuesday + # Also Additional new year's day is observed on monday if on the weekend + arguments: date + source: | + if [0,6].include?(date.wday) + date += 2 if date.wday == 6 + date += 1 if date.wday == 0 + date + else + nil + end + additional_holiday_on_monday_if_on_sunday: + # SA doesn't get an additional christmas day if it falls on a saturday + arguments: date + source: | + if date.wday == 0 + date += 1 + date + else + nil + end + sa_christmas_exclude_saturday: + arguments: date + source: | + if date.wday == 6 + date += 2 + date + else + date + end + to_monday_if_saturday_or_to_tuesday_if_sunday_or_monday: # NT/SA has boxing day on tuesday if on monday instead + arguments: date + source: | + if [6,0].include?(date.wday) + date += 2 + date + elsif date.wday == 1 + date += 1 + date else - Date.civil(year, 8, first_friday) + 5 + date end - to_nearest_monday_after: + to_tuesday_if_monday: # SA moves boxing day to after christmas day instead arguments: date - ruby: | - case date.wday - when 6 - date += 2 - when 5 - date += 3 - when 4 - date += 4 - when 3 - date += 5 - when 2 - date += 6 - when 0 - date += 1 - end + source: | + if date.wday == 1 + date += 1 date + else + date + end tests: - given: - date: "2017-04-14" - regions: ["au"] + date: '2020-04-25' + regions: ["au_act"] expect: - name: "Good Friday" + name: 'ANZAC Day' - given: - date: "2017-04-15" - regions: ["au_nsw"] + date: '2020-04-25' + regions: ["au_qld"] expect: - name: "Easter Saturday" + name: 'ANZAC Day' - given: - date: ['2010-4-4', "2017-04-16"] - regions: ["au_nsw"] + date: '2021-04-27' + regions: ["au_wa"] expect: - name: "Easter Sunday" + name: 'Additional public holiday for ANZAC Day' - given: - date: ['2024-03-31'] - regions: ["au_sa"] + date: '2021-12-25' + regions: ["au_qld"] expect: - name: "Easter Sunday" + name: 'Christmas Day' + - given: + date: '2021-12-27' + regions: ["au_qld"] + expect: + name: 'Additional public holiday for Christmas Day' + - given: + date: '2021-12-26' + regions: ["au_qld"] + expect: + name: 'Boxing Day' + - given: + date: '2021-12-28' + regions: ["au_qld"] + expect: + name: 'Additional public holiday for Boxing Day' - given: date: '2013-10-07' regions: ["au_qld"] @@ -361,11 +511,21 @@ tests: regions: ["au_qld"] expect: name: "Queen's Birthday" + - given: + date: ['2023-10-02',"2024-10-07"] + regions: ["au_qld"] + expect: + name: "King's Birthday" - given: date: ['2014-09-29', '2015-09-28', '2016-09-26'] regions: ["au_wa"] expect: name: "Queen's Birthday" + - given: + date: ['2023-09-25','2024-09-23', '2025-09-30'] + regions: ["au_wa"] + expect: + name: "King's Birthday" - given: date: '2014-09-29' regions: ["au_act"] @@ -381,6 +541,12 @@ tests: regions: ["au_act"] expect: name: 'Family & Community Day' + - given: + date: ['2017-05-29', '2018-05-28', '2019-05-27', '2020-06-01'] + regions: ["au_act"] + options: ["observed"] + expect: + name: 'ACT Reconciliation Day' - given: date: '2014-01-26' regions: ["au_qld"] @@ -518,6 +684,11 @@ tests: regions: ["au_vic_melbourne"] expect: name: 'Melbourne Cup Day' + - given: + date: '2019-11-05' + regions: ["au_vic"] + expect: + name: 'Melbourne Cup Day' - given: date: '2015-10-02' regions: ["au_vic"] @@ -533,6 +704,46 @@ tests: regions: ["au_vic"] expect: name: 'Friday before the AFL Grand Final' + - given: + date: '2018-09-28' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' + - given: + date: '2019-09-27' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' + - given: + date: '2020-10-23' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' + - given: + date: '2021-09-24' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' + - given: + date: '2022-09-23' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' + - given: + date: '2023-09-29' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' + - given: + date: '2024-09-27' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' + - given: + date: '2025-09-26' + regions: ["au_vic"] + expect: + name: 'Friday before the AFL Grand Final' - given: date: '2005-05-16' regions: ["au_sa"] @@ -580,6 +791,11 @@ tests: options: ["observed"] expect: name: "Boxing Day" + - given: + date: '2020-12-26' + regions: ["au_qld"] + expect: + name: "Additional public holiday for Boxing Day" - given: date: '2015-12-26' regions: ["au_sa"] @@ -691,6 +907,16 @@ tests: regions: ["au_sa"] expect: name: 'Christmas Day' + - given: + date: '2021-12-25' + regions: ["au_sa"] + expect: + holiday: false + - given: + date: '2022-12-25' + regions: ["au_sa"] + expect: + name: 'Christmas Day' - given: date: '2016-12-26' regions: ["au_sa"] @@ -791,72 +1017,37 @@ tests: expect: name: "New Year's Day" - given: - date: '2016-03-27' - regions: ["au_qld"] + date: '2022-01-03' + regions: ["au_nsw, au_vic, au_act, au_sa, au_wa, au_nt, au_qld"] expect: - holiday: false + name: "Additional public holiday for New Year's Day" + - given: + date: '2022-01-01' + regions: ["au_nsw, au_vic, au_act, au_sa, au_wa, au_nt, au_qld"] + expect: + name: "New Year's Day" - given: date: '2017-04-16' regions: ["au_qld"] expect: name: "Easter Sunday" - given: - date: "2014-11-14" - regions: ["au_qld_brisbane"] - expect: - name: "G20 Day" - - given: - date: '2021-04-26' - regions: ["au_vic"] - expect: - holiday: false - - given: - date: '2019-08-14' - regions: ["au_qld_brisbane"] - expect: - name: "Ekka" - - given: - date: '2022-08-10' - regions: ["au_qld_brisbane"] - expect: - name: "Ekka" - - given: - date: '2023-08-16' - regions: ["au_qld_brisbane"] - expect: - name: "Ekka" - - given: - date: '2024-08-14' - regions: ["au_qld_brisbane"] - expect: - name: "Ekka" - - given: - date: '2025-08-13' - regions: ["au_qld_brisbane"] - expect: - name: "Ekka" - - given: - date: '2022-09-22' - regions: ['au'] + date: '2022-04-17' + regions: ["au_wa"] expect: - name: "National Day of Mourning for Her Majesty Queen Elizabeth II" + name: "Easter Sunday" - given: - date: '2023-09-22' - regions: ['au'] + date: '2021-08-02' + regions: ["au-nt"] expect: - holiday: false + name: "Picnic Day" - given: - date: '2021-09-22' - regions: ['au'] + date: '2022-04-17' + regions: ["au-nt"] expect: holiday: false - given: - date: '2024-05-27' - regions: ['au_act'] - expect: - name: "Reconciliation Day" - - given: - date: '2025-06-02' - regions: ['au_act'] + date: '2023-04-09' + regions: ["au_nt"] expect: - name: "Reconciliation Day" + name: "Easter Sunday" From 622e6218c30ad4a1d0348be002129085edc19fd3 Mon Sep 17 00:00:00 2001 From: JAMES MOSS Date: Wed, 28 Feb 2024 14:33:22 +1000 Subject: [PATCH 190/195] Hotfix: manually added the holiday --- au.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/au.yaml b/au.yaml index 2a3a3ae..f9fcb2a 100644 --- a/au.yaml +++ b/au.yaml @@ -25,6 +25,11 @@ months: function: easter(year) year_ranges: - after: 2017 + - name: Easter Sunday + regions: [au_sa] + function: easter(year) + year_ranges: + from: 2024 - name: Easter Sunday regions: [au_wa] function: easter(year) @@ -1031,6 +1036,11 @@ tests: regions: ["au_qld"] expect: name: "Easter Sunday" + - given: + date: ['2024-03-31'] + regions: ["au_sa"] + expect: + name: "Easter Sunday" - given: date: '2022-04-17' regions: ["au_wa"] From a671aa030aca2319c17381ffc895386825fdf5c1 Mon Sep 17 00:00:00 2001 From: JAMES MOSS Date: Wed, 28 Feb 2024 15:22:59 +1000 Subject: [PATCH 191/195] hotfix: update a keyword to be correct --- au.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.yaml b/au.yaml index f9fcb2a..0bfb458 100644 --- a/au.yaml +++ b/au.yaml @@ -29,7 +29,7 @@ months: regions: [au_sa] function: easter(year) year_ranges: - from: 2024 + - after: 2024 - name: Easter Sunday regions: [au_wa] function: easter(year) From c1f9e334045659d6f08e374962fa35b3da051d9a Mon Sep 17 00:00:00 2001 From: Steve Aziz <68991236+ScAziz@users.noreply.github.com> Date: Mon, 17 Jun 2024 13:49:57 +0100 Subject: [PATCH 192/195] update naming for sg: --- sg.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sg.yaml b/sg.yaml index 2cb1995..7d3b605 100644 --- a/sg.yaml +++ b/sg.yaml @@ -13,11 +13,11 @@ months: regions: [sg] function: easter(year) function_modifier: -2 - - name: Lunar New Year's Day + - name: Chinese New Year regions: [sg] function: cn_new_lunar_day(year) observed: to_monday_if_sunday(date) - - name: The second day of Lunar New Year + - name: The second day of Chinese New Year regions: [sg] function: cn_new_lunar_day(year) function_modifier: 1 From e26496b22159029b0ab6608499cfafa9285f246d Mon Sep 17 00:00:00 2001 From: Steve Aziz <68991236+ScAziz@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:20:12 +0100 Subject: [PATCH 193/195] update st brigids day for 2025 --- ie.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ie.yaml b/ie.yaml index c07315f..19e68f2 100644 --- a/ie.yaml +++ b/ie.yaml @@ -20,7 +20,7 @@ months: 2: - name: St Brigid's Day regions: [ie] - mday: 5 + mday: 3 3: - name: St. Patrick's Day regions: [ie] From b1f672106081998b90b2d57bb603e6fb9d147941 Mon Sep 17 00:00:00 2001 From: Daniel Gilchrist Date: Thu, 30 Jan 2025 10:02:06 +0000 Subject: [PATCH 194/195] Fix St Brigid's Day for Ireland not being configured properly We should not be hard coding this to a day in the month. This change essentially says "The first weekday of the first week" which is essentially the first Monday of the month (Februrary) --- ie.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ie.yaml b/ie.yaml index 19e68f2..a08564d 100644 --- a/ie.yaml +++ b/ie.yaml @@ -20,7 +20,8 @@ months: 2: - name: St Brigid's Day regions: [ie] - mday: 3 + week: 1 + wday: 1 3: - name: St. Patrick's Day regions: [ie] @@ -67,6 +68,11 @@ tests: regions: ["ie"] expect: name: "St Brigid's Day" + - given: + date: '2025-02-01' + regions: ["ie"] + expect: + name: "St Brigid's Day" - given: date: '2008-03-17' regions: ["ie"] From 5cc24c64173b22d774be4f7792e9667ff38d02de Mon Sep 17 00:00:00 2001 From: mustafanda Date: Tue, 15 Apr 2025 11:06:43 +0100 Subject: [PATCH 195/195] Update sg.yaml --- sg.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sg.yaml b/sg.yaml index 7d3b605..e26a265 100644 --- a/sg.yaml +++ b/sg.yaml @@ -60,7 +60,6 @@ months: - name: National Day regions: [sg] mday: 9 - observed: to_weekday_if_weekend(date) 12: - name: Christmas Day regions: [sg] @@ -161,7 +160,7 @@ methods: when 2024 [06, 17] when 2025 - [06, 6] + [06, 7] when 2026 [05, 27] end