on 65048fe help sign in
37 lines 625 B history raw
1### `++daws`
3Weekday of date
5Produces the day of the week of a given date `yed` as an atom. Weeks are
6zero-indexed beginning on Sunday.
8Accepts
9-------
11`yed` is a [`++date`]().
13Produces
14--------
16An atom.
18Source
19------
21 ++ daws :: weekday of date
22 |= yed=date
23 %- mod :_ 7
24 (add (dawn y.yed) (sub (yawn [y.yed m.yed d.t.yed]) (yawn y.yed 1 1)))
25 ::
27Examples
28--------
30 ~zod/try=> (daws [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]])
31 5
32 ~zod/try=> (daws (yore -<-))
33 2
35(second example always returns the current date).