]> gitweb.factorcode.org Git - factor.git/commitdiff
calendar.holidays.us: Update nth day of week for base 0.
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 7 Nov 2020 01:14:01 +0000 (19:14 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sat, 7 Nov 2020 01:14:01 +0000 (19:14 -0600)
extra/calendar/holidays/us/us-tests.factor
extra/calendar/holidays/us/us.factor

index 67ac8fc1edb5c1c39897c68b347c46733db0d352..69273ef0371704a16083f0ff076b25994962969f 100644 (file)
@@ -1,6 +1,73 @@
 ! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: calendar.holidays calendar.holidays.us kernel sequences
-tools.test ;
+USING: calendar calendar.holidays calendar.holidays.us kernel
+sequences tools.test ;
 
 { 10 } [ 2009 us-federal holidays length ] unit-test
+
+{
+    {
+        T{ timestamp
+            { year 2020 }
+            { month 1 }
+            { day 1 }
+            { gmt-offset T{ duration { hour -6 } } }
+        }
+        T{ timestamp
+            { year 2020 }
+            { month 1 }
+            { day 20 }
+            { gmt-offset T{ duration { hour -6 } } }
+        }
+        T{ timestamp
+            { year 2020 }
+            { month 2 }
+            { day 17 }
+            { gmt-offset T{ duration { hour -6 } } }
+        }
+        T{ timestamp
+            { year 2020 }
+            { month 5 }
+            { day 25 }
+            { gmt-offset T{ duration { hour -6 } } }
+        }
+        T{ timestamp
+            { year 2020 }
+            { month 7 }
+            { day 3 }
+            { gmt-offset T{ duration { hour -6 } } }
+        }
+        T{ timestamp
+            { year 2020 }
+            { month 9 }
+            { day 7 }
+            { gmt-offset T{ duration { hour -6 } } }
+        }
+        T{ timestamp
+            { year 2020 }
+            { month 10 }
+            { day 12 }
+            { gmt-offset T{ duration { hour -6 } } }
+        }
+        T{ timestamp
+            { year 2020 }
+            { month 11 }
+            { day 11 }
+            { gmt-offset T{ duration { hour -6 } } }
+        }
+        T{ timestamp
+            { year 2020 }
+            { month 11 }
+            { day 26 }
+            { gmt-offset T{ duration { hour -6 } } }
+        }
+        T{ timestamp
+            { year 2020 }
+            { month 12 }
+            { day 25 }
+            { gmt-offset T{ duration { hour -6 } } }
+        }
+    }
+} [
+    2020 <year> timestamp>year-dates [ us-federal holiday? ] filter
+] unit-test
\ No newline at end of file
index 5315cae675f5a7b6e44ef9d492ce81b946522d35..9ad2ecc5b220777591abbaf9285462e98d88a030 100644 (file)
@@ -30,13 +30,13 @@ HOLIDAY: new-years-day january 1 >>day ;
 HOLIDAY-NAME: new-years-day world "New Year's Day"
 HOLIDAY-NAME: new-years-day us-federal "New Year's Day"
 
-HOLIDAY: martin-luther-king-day january 3 monday-of-month ;
+HOLIDAY: martin-luther-king-day january 2 monday-of-month ;
 HOLIDAY-NAME: martin-luther-king-day us-federal "Martin Luther King Day"
 
 HOLIDAY: inauguration-day january 20 >>day [ dup 4 neg rem + ] change-year ;
 HOLIDAY-NAME: inauguration-day us "Inauguration Day"
 
-HOLIDAY: washingtons-birthday february 3 monday-of-month ;
+HOLIDAY: washingtons-birthday february 2 monday-of-month ;
 HOLIDAY-NAME: washingtons-birthday us-federal "Washington's Birthday"
 
 HOLIDAY: memorial-day may last-monday-of-month ;
@@ -45,15 +45,15 @@ HOLIDAY-NAME: memorial-day us-federal "Memorial Day"
 HOLIDAY: independence-day july 4 >>day ;
 HOLIDAY-NAME: independence-day us-federal "Independence Day"
 
-HOLIDAY: labor-day september 1 monday-of-month ;
+HOLIDAY: labor-day september 0 monday-of-month ;
 HOLIDAY-NAME: labor-day us-federal "Labor Day"
 
-HOLIDAY: columbus-day october 2 monday-of-month ;
+HOLIDAY: columbus-day october 1 monday-of-month ;
 HOLIDAY-NAME: columbus-day us-federal "Columbus Day"
 
 HOLIDAY-NAME: armistice-day us-federal "Veterans Day"
 
-HOLIDAY: thanksgiving-day november 4 thursday-of-month ;
+HOLIDAY: thanksgiving-day november 3 thursday-of-month ;
 HOLIDAY-NAME: thanksgiving-day us-federal "Thanksgiving Day"
 
 HOLIDAY: christmas-day december 25 >>day ;
@@ -86,15 +86,15 @@ HOLIDAY: administrative-professionals-day april last-saturday-of-month wednesday
 
 HOLIDAY: cinco-de-mayo may 5 >>day ;
 
-HOLIDAY: mothers-day may 2 sunday-of-month ;
+HOLIDAY: mothers-day may 1 sunday-of-month ;
 
-HOLIDAY: armed-forces-day may 3 saturday-of-month ;
+HOLIDAY: armed-forces-day may 2 saturday-of-month ;
 
-HOLIDAY: national-donut-day june 1 friday-of-month ;
+HOLIDAY: national-donut-day june 0 friday-of-month ;
 
 HOLIDAY: flag-day june 14 >>day ;
 
-HOLIDAY: parents-day july 4 sunday-of-month ;
+HOLIDAY: parents-day july 3 sunday-of-month ;
 
 HOLIDAY: grandparents-day labor-day 1 weeks time+ ;
 
@@ -106,11 +106,11 @@ HOLIDAY: citizenship-day september 17 >>day ;
 
 HOLIDAY: bosss-day october 16 >>day ;
 
-HOLIDAY: sweetest-day october 3 saturday-of-month ;
+HOLIDAY: sweetest-day october 2 saturday-of-month ;
 
 HOLIDAY: halloween october 31 >>day ;
 
-HOLIDAY: election-day november 1 monday-of-month 1 days time+ ;
+HOLIDAY: election-day november 0 monday-of-month 1 days time+ ;
 
 HOLIDAY: black-friday thanksgiving-day 1 days time+ ;