=
] unit-test
-
! forwards
{
{
-1 days <timestamp-range> >array
] unit-test
+! duration to
+{
+ {
+ T{ timestamp { year 2023 } { month 6 } { day 21 } }
+ T{ timestamp { year 2023 } { month 6 } { day 24 } }
+ T{ timestamp { year 2023 } { month 6 } { day 27 } }
+ T{ timestamp { year 2023 } { month 6 } { day 30 } }
+ }
+} [
+ 2023 06 21 <date-utc> 10 days
+ 3 days <timestamp-range> >array
+] unit-test
{ step duration read-only } ;
: <timestamp-range> ( from to step -- timestamp-range )
- [ over time- ] dip [
+ [ dup duration? [ over time+ ] when over time- ] dip [
[ duration>seconds ] bi@ sign/mod 0 < [ 1 + ] unless 0 max
] keep timestamp-range boa ;