diff --git a/au.yaml b/au.yaml index a8d608f..b352aee 100644 --- a/au.yaml +++ b/au.yaml @@ -19,15 +19,24 @@ months: - name: Easter Sunday regions: [au_nsw, au_vic] function: easter(year) + - name: Easter Sunday + regions: [au_qld] + function: easter(year) + year_ranges: + - after: 2017 - name: Easter Monday regions: [au] function: easter(year) function_modifier: 1 1: - name: New Year's Day - regions: [au] + regions: [au_nsw, au_vic, au_act, au_sa, au_wa, au_nt, au_qld] mday: 1 observed: to_monday_if_weekend(date) + - name: New Year's Day + regions: [au_tas] + mday: 1 + function: to_monday_if_weekend(date) - name: Australia Day regions: [au] mday: 26 @@ -53,6 +62,10 @@ months: - name: March Public Holiday regions: [au_sa] function: march_pub_hol_sa(year) + - name: Canberra Day + regions: [au_act] + week: 2 + wday: 1 4: - name: ANZAC Day regions: [au] @@ -378,8 +391,14 @@ tests: | assert_equal "Christmas Day", Date.civil(2016, 12, 27).holidays(:au_nt, :observed)[0][:name] # NEW YEAR'S DAY - observed on both 1st and 2nd of Jan for 2017 - regions = [:au_qld, :au_nsw, :au_act, :au_vic, :au_tas, :au_sa, :au_wa, :au_nt] + regions = [:au_qld, :au_nsw, :au_act, :au_vic, :au_sa, :au_wa, :au_nt] regions.each do |r| assert_equal "New Year's Day", Date.civil(2017, 1, 1).holidays(r)[0][:name] assert_equal "New Year's Day", Date.civil(2017, 1, 2).holidays(r, :observed)[0][:name] - end \ No newline at end of file + end + # Tasmania is different + assert_equal [], Date.civil(2017,1,1).holidays(:au_tas) + assert_equal "New Year's Day", Date.civil(2017, 1, 2).holidays(:au_tas)[0][:name] + + #QLD now celebrates Easter Sunday + assert_equal "Easter Sunday", Date.civil(2017, 4, 16).holidays(:au_qld)[0][:name] \ No newline at end of file diff --git a/vi.yaml b/vi.yaml index 0eddd51..419e699 100644 --- a/vi.yaml +++ b/vi.yaml @@ -5,25 +5,25 @@ --- months: 1: - - name: New Year + - name: Tết dương lịch regions: [vi] mday: 1 4: - - name: Liberation Day + - name: "Ngày Giải phóng miền Nam, thống nhất đất nước" regions: [vi] mday: 30 5: - - name: International Workers' Day + - name: Ngày Quốc tế Lao động regions: [vi] mday: 1 9: - - name: National Day + - name: Quốc khánh regions: [vi] mday: 2 tests: | - {Date.civil(2014,1,1) => 'New Year', - Date.civil(2014,4,30) => 'Liberation Day', - Date.civil(2014,5,1) => "International Workers' Day", - Date.civil(2014,9,2) => 'National Day'}.each do |date, name| + {Date.civil(2014,1,1) => 'Tết dương lịch', + Date.civil(2014,4,30) => 'Ngày Giải phóng miền Nam, thống nhất đất nước', + Date.civil(2014,5,1) => "Ngày Quốc tế Lao động", + Date.civil(2014,9,2) => 'Quốc khánh'}.each do |date, name| assert_equal name, (Holidays.on(date, :vi)[0] || {})[:name] end