]> gitweb.factorcode.org Git - factor.git/commitdiff
calendar: removing weekdays-between2
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 13 Apr 2023 22:17:45 +0000 (15:17 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 13 Apr 2023 22:17:45 +0000 (15:17 -0700)
basis/calendar/calendar-tests.factor
basis/calendar/calendar.factor

index 51476b0d6969494d6404839ca10cfedcadbd091d..11690fdb18eb024ea1a6ad574e8e7ae898e620be 100644 (file)
@@ -314,18 +314,6 @@ IN: calendar
     dup 1 tail swap v- [ 1 <= ] all?
 ] unit-test
 
-{ 0 } [
-    2014 1 1 <date-gmt>
-    2014 <year-gmt> timestamp>year-dates-gmt
-    [ weekdays-between2 ] with map
-
-    2014 1 1 <date-gmt>
-    2014 <year-gmt> timestamp>year-dates-gmt
-    [ weekdays-between ] with map
-
-    v- sum
-] unit-test
-
 {
     {
         T{ timestamp { year 2020 } { month 3 } { day 1 } }
index d7bbdd2a206d40682349fb4a14c7000b4b857b7e..8b326eb26eaadbfc597c390c1492431a27956131 100644 (file)
@@ -762,15 +762,6 @@ ALIAS: last-day-of-week saturday
     day-of-week 6 = [ [ 1 - ] dip ] when
     day-of-week 0 = [ 1 - ] when ;
 
-CONSTANT: weekday-offsets { 0 0 1 2 3 4 5 }
-
-: weekdays-between2 ( date1 date2 -- n )
-    [ swap time- duration>days 1 + ]
-    [ [ day-of-week ] bi@ 6 swap - ] 2bi
-
-    [ + + 1.4 /i ]
-    [ [ weekday-offsets nth ] bi@ + ] 2bi - ;
-
 : sunday-of-month ( timestamp n -- timestamp' ) 0 nth-day-this-month ;
 : monday-of-month ( timestamp n -- timestamp' ) 1 nth-day-this-month ;
 : tuesday-of-month ( timestamp n -- timestamp' ) 2 nth-day-this-month ;