]> gitweb.factorcode.org Git - factor.git/blob - extra/calendar/holidays/us/us.factor
messed up inauguration-day
[factor.git] / extra / calendar / holidays / us / us.factor
1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors calendar kernel math words ;
4 IN: calendar.holidays.us
5
6 <<
7 SYNTAX: us-federal
8     word "us-federal" dup set-word-prop ;
9 >>
10
11 ! Federal Holidays
12 : new-years-day ( timestamp/n -- timestamp )
13     january 1 >>day ; us-federal
14
15 : martin-luther-king-day ( timestamp/n -- timestamp )
16     january 3 monday-of-month ; us-federal
17
18 : inauguration-day ( timestamp/n -- timestamp )
19     year dup neg 4 rem + january 20 >>day ; us-federal
20
21 : washington's-birthday ( timestamp/n -- timestamp )
22     february 3 monday-of-month ; us-federal
23
24 ALIAS: presidents-day washington's-birthday us-federal
25
26 : memorial-day ( timestamp/n -- timestamp )
27     may last-monday-of-month ; us-federal
28
29 : independence-day ( timestamp/n -- timestamp )
30     july 4 >>day ; us-federal
31
32 : labor-day ( timestamp/n -- timestamp )
33     september 1 monday-of-month ; us-federal
34
35 : columbus-day ( timestamp/n -- timestamp )
36     october 2 monday-of-month ; us-federal
37
38 : veterans'-day ( timestamp/n -- timestamp )
39     november 11 >>day ; us-federal
40
41 : thanksgiving-day ( timestamp/n -- timestamp )
42     november 4 thursday-of-month ; us-federal
43
44 : christmas-day ( timestamp/n -- timestamp )
45     december 25 >>day ; us-federal
46
47 ! Other Holidays
48
49 : belly-laugh-day ( timestamp/n -- timestamp )
50     january 24 >>day ;
51
52 : groundhog-day ( timestamp/n -- timestamp )
53     february 2 >>day ;
54
55 : lincoln's-birthday ( timestamp/n -- timestamp )
56     february 12 >>day ;
57
58 : valentine's-day ( timestamp/n -- timestamp )
59     february 14 >>day ;
60
61 : st-patrick's-day ( timestamp/n -- timestamp )
62     march 17 >>day ;
63
64 : ash-wednesday ( timestamp/n -- timestamp )
65     easter 46 days time- ;
66
67 ALIAS: first-day-of-lent ash-wednesday
68
69 : fat-tuesday ( timestamp/n -- timestamp )
70     ash-wednesday 1 days time- ;
71
72 : good-friday ( timestamp/n -- timestamp )
73     easter 2 days time- ;
74
75 : tax-day ( timestamp/n -- timestamp )
76     april 15 >>day ;
77
78 : earth-day ( timestamp/n -- timestamp )
79     april 22 >>day ;
80
81 : administrative-professionals'-day ( timestamp/n -- timestamp )
82     april last-saturday-of-month wednesday ;
83
84 : cinco-de-mayo ( timestamp/n -- timestamp )
85     may 5 >>day ;
86
87 : mother's-day ( timestamp/n -- timestamp )
88     may 2 sunday-of-month ;
89
90 : armed-forces-day ( timestamp/n -- timestamp )
91     may 3 saturday-of-month ;
92
93 : flag-day ( timestamp/n -- timestamp )
94     june 14 >>day ;
95
96 : parents'-day ( timestamp/n -- timestamp )
97     july 4 sunday-of-month ;
98
99 : grandparents'-day ( timestamp/n -- timestamp )
100     labor-day 1 weeks time+ ;
101
102 : patriot-day ( timestamp/n -- timestamp )
103     september 11 >>day ;
104
105 : stepfamily-day ( timestamp/n -- timestamp )
106     september 16 >>day ;
107
108 : citizenship-day ( timestamp/n -- timestamp )
109     september 17 >>day ;
110
111 : boss's-day ( timestamp/n -- timestamp )
112     october 16 >>day ;
113
114 : sweetest-day ( timestamp/n -- timestamp )
115     october 3 saturday-of-month ;
116
117 : halloween ( timestamp/n -- timestamp )
118     october 31 >>day ;
119
120 : election-day ( timestamp/n -- timestamp )
121     november 1 monday-of-month 1 days time+ ;
122
123 : black-friday ( timestamp/n -- timestamp )
124     thanksgiving-day 1 days time+ ;
125
126 : pearl-harbor-remembrance-day ( timestamp/n -- timestamp )
127     december 7 >>day ;
128
129 : new-year's-eve ( timestamp/n -- timestamp )
130     december 31 >>day ;