-
Notifications
You must be signed in to change notification settings - Fork 0
/
argentina.jl
60 lines (54 loc) · 1.4 KB
/
argentina.jl
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
"""
ArgentinaCalendar
Buenos Aires, Argentina, stock exchange calendar.
"""
struct ArgentinaCalendar <: WesternCalendar end
function isbusinessday(date::Date, calendar::ArgentinaCalendar)
y, m, d = yearmonthday(date)
w = dayofweek(date)
dd = dayofyear(date)
em = eastermonday(y, calendar)
# TODO: la realidad es que hay que agregar cosas aqui
if (
isweekend(w)
# New Year's Day
||
(m, d) == (January, 1)
# Holy Thursday
||
(dd == em - 4)
# Good Friday
||
(dd == em - 3)
# Labour Day
||
(m, d) == (May, 1)
# May Revolution
||
(m, d) == (May, 25)
# Death of General Manuel Belgrano
||
((15 <= d <= 21) && w == Monday && m == June)
# Independence Day
||
(m, d) == (July, 9)
# Death of General José de San Martín
||
((15 <= d <= 21) && w == Monday && m == August)
# Columbus Day or Day of Respect for Cultural Diversity
||
((d == 10 || d == 11 || d == 12 || d == 15 || d == 16) && w == Monday && m == October)
# Immaculate Conception
||
(m, d) == (December, 8)
# Christmas
||
(m, d) == (December, 25)
# New Year's Eve
||
(m, d) == (December, 31)
)
return false
end
return true
end