]> gitweb.factorcode.org Git - factor.git/commitdiff
calendar: fix timestamp>year-dates-gmt.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 13 Dec 2020 19:26:36 +0000 (11:26 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 13 Dec 2020 19:26:36 +0000 (11:26 -0800)
basis/calendar/calendar.factor

index 8997f0e70a5177f86293fc612f6c2e1b47daa0a7..1e465d518fa078b8f05ad170cf2390a97ec4244e 100644 (file)
@@ -400,7 +400,7 @@ DEFER: end-of-year
 PRIVATE>
 
 GENERIC: time- ( time1 time2 -- time3 )
-
+surround
 M: timestamp time-
     ! Exact calendar-time difference
     (time-) seconds ;
@@ -795,8 +795,7 @@ CONSTANT: weekday-offsets { 0 0 1 2 3 4 5 }
     swap 367 366 ? mod ;
 
 : timestamp>year-dates-gmt ( timestamp -- seq )
-    [ start-of-year >date< julian-day-number ]
-    [ days-in-year ] bi
+    [ year>> 1 1 julian-day-number ] [ days-in-year ] bi
     [ drop ] [ + ] 2bi
     [a..b) [ julian-day-number>date <date-gmt> ] map ;