This repository has been archived by the owner on Jun 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathoptions.go
191 lines (164 loc) · 4.57 KB
/
options.go
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
package workalendar
import "time"
const (
newYearDay string = "1/1"
labourDay string = "5/1"
christmasDay string = "12/25"
christmasEve string = "12/24"
boxingDay string = "12/26"
ortodoxChristmasDay string = "1/7"
epiphanyDay string = "1/6"
assumptionDay string = "8/15"
allSaints string = "11/1"
immaculateConception string = "12/8"
)
//WithHolidayFunc is inteded to add HolidayFunc
func WithHolidayFunc(additionalHolidaysFunc func(date time.Time) Holidays) CalendarOption {
return func(c *Calendar) {
c.additionalHolidays = additionalHolidaysFunc
}
}
//WithOrthodoxChristmas is option implementing orthodox christmas
func WithOrthodoxChristmas() CalendarOption {
return func(c *Calendar) {
c.Days[ortodoxChristmasDay] = Event("Christmas")
}
}
//WithChristmas is option implementing christmas
func WithChristmas() CalendarOption {
return func(c *Calendar) {
c.Days[christmasDay] = Event("Christmas Day")
}
}
//WithChristmasEve is option implementing christmas eve
func WithChristmasEve() CalendarOption {
return func(c *Calendar) {
c.Days[christmasEve] = Event("Christmas Eve")
}
}
//WithBoxingDay is option implementing boxing day
func WithBoxingDay() CalendarOption {
return func(c *Calendar) {
c.Days[boxingDay] = Event("Boxing Day")
}
}
//WithNewYearDay is option implementing newyear day
func WithNewYearDay() CalendarOption {
return func(c *Calendar) {
c.Days[newYearDay] = Event("New Year")
}
}
//WithLabourDay is option implementing labour day
func WithLabourDay() CalendarOption {
return func(c *Calendar) {
c.Days[labourDay] = Event("Labour Day")
}
}
//WithEasterSaturday is option implementing easter Saturday
func WithEasterSaturday() CalendarOption {
return func(c *Calendar) {
c.includeEasterSaturday = true
}
}
//WithEasterSunday is option implementing easter sunday
func WithEasterSunday() CalendarOption {
return func(c *Calendar) {
c.includeEasterSunday = true
}
}
//WithEasterMonday is option implementing easter monday
func WithEasterMonday() CalendarOption {
return func(c *Calendar) {
c.includeEasterMonday = true
}
}
//WithEasterTuesday is option implementing easter tuesday
func WithEasterTuesday() CalendarOption {
return func(c *Calendar) {
c.includeEasterTuesday = true
}
}
//WithWhitMonday is option implementing whit monday
func WithWhitMonday() CalendarOption {
return func(c *Calendar) {
c.includeWhitMonday = true
}
}
//WithWhitSunday is option implementing whit sunday
func WithWhitSunday() CalendarOption {
return func(c *Calendar) {
c.includeWhitSunday = true
}
}
//WithGoodFriday is option implementing good friday
func WithGoodFriday() CalendarOption {
return func(c *Calendar) {
c.includeGoodFriday = true
}
}
//WithAscension is option implementing good friday
func WithAscension() CalendarOption {
return func(c *Calendar) {
c.includeAscension = true
}
}
//WithEpiphany is option implementing good friday
func WithEpiphany() CalendarOption {
return func(c *Calendar) {
c.Days[epiphanyDay] = Event("Epiphany")
}
}
//WithCorpusChristi is option implementing Corpus Christi
func WithCorpusChristi() CalendarOption {
return func(c *Calendar) {
c.includeCorpusChristi = true
}
}
//WithAssumption is option implementing Assumption
func WithAssumption() CalendarOption {
return func(c *Calendar) {
c.Days[assumptionDay] = Event("Assumption of Mary to Heaven")
}
}
//WithAllSaints is option implementing All Saints
func WithAllSaints() CalendarOption {
return func(c *Calendar) {
c.Days[allSaints] = Event("All Saints Day")
}
}
//WithImmaculateConception is option implementing Immaculate Conception
func WithImmaculateConception() CalendarOption {
return func(c *Calendar) {
c.Days[immaculateConception] = Event("Immaculate Conception")
}
}
//WithRadonitsa is option implementing Radonitsa
func WithRadonitsa() CalendarOption {
return func(c *Calendar) {
c.includeRadonitsa = true
}
}
//WithCleanMonday is option implementing clean monday
func WithCleanMonday() CalendarOption {
return func(c *Calendar) {
c.includeCleanMonday = true
}
}
//WithHolyThursday is option implementing holy thursday
func WithHolyThursday() CalendarOption {
return func(c *Calendar) {
c.includeHolyThursday = true
}
}
//WithFatTuesday is option implementing fat tuesday
func WithFatTuesday() CalendarOption {
return func(c *Calendar) {
c.includeFatTuesday = true
}
}
//EnableOrthodox is option implementing orthodox method to calculate easter sunday
func EnableOrthodox() CalendarOption {
return func(c *Calendar) {
c.easterMethod = EasterOrthodox
}
}