Function: calendar-dayname-on-or-before
calendar-dayname-on-or-before is a byte-compiled function defined in
calendar.el.gz.
Signature
(calendar-dayname-on-or-before DAYNAME DATE)
Documentation
Return the absolute date of the DAYNAME on or before absolute DATE.
DAYNAME=0 means Sunday, DAYNAME=1 means Monday, and so on.
Note: Applying this function to d+6 gives us the DAYNAME on or after an absolute day d. Similarly, applying it to d+3 gives the DAYNAME nearest to absolute date d, applying it to d-1 gives the DAYNAME previous to absolute date d, and applying it to d+7 gives the DAYNAME following absolute date d.
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/calendar.el.gz
(defun calendar-dayname-on-or-before (dayname date)
"Return the absolute date of the DAYNAME on or before absolute DATE.
DAYNAME=0 means Sunday, DAYNAME=1 means Monday, and so on.
Note: Applying this function to d+6 gives us the DAYNAME on or after
an absolute day d. Similarly, applying it to d+3 gives the DAYNAME
nearest to absolute date d, applying it to d-1 gives the DAYNAME
previous to absolute date d, and applying it to d+7 gives the DAYNAME
following absolute date d."
(- date (% (- date dayname) 7)))