Handbook
Glossary
week-of-year ( timestamp day -- n )
Vocabulary
formatting
.
private
Inputs
timestamp
an
object
day
an
object
Outputs
n
an
object
Definition
USING:
calendar
calendar.private
kernel
math
;
IN:
formatting.private
:
week-of-year
( timestamp day -- n )
[
dup
clone
first-day-of-year
dup
clone
]
[
day-this-week
]
bi*
swap
[
time-
duration>days
]
curry
bi@
dup
0
<
[
7
+
-
]
[
drop
]
if
7
+
7
/i
;