forked from holidays/definitions
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnf.yaml
119 lines (117 loc) · 2.63 KB
/
nf.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# 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: (additional day New Year's Day)
regions: [nf]
mday: 1
observed: to_monday_if_weekend(date)
- name: Australia Day
regions: [nf]
mday: 26
observed: to_monday_if_weekend(date)
3:
- 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]
mday: 25
6:
- 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)
10:
- name: Norfolk Island Agricultural Show
regions: [nf]
week: 2
wday: 1
11:
- name: Thanksgiving Day
regions: [nf]
week: 5
wday: 3
12:
- name: Christmas Day
regions: [nf]
mday: 25
- name: (additional day Christmas Day)
regions: [nf]
mday: 25
function: to_tuesday_if_sunday(date)
- 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
to_tuesday_if_sunday:
arguments: date
source: |
if [6,0].include?(date.wday)
date += 2
date
else
nil
end
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"
- 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"