Function: icalendar-first-weekday-of-year

icalendar-first-weekday-of-year is a byte-compiled function defined in icalendar.el.gz.

Signature

(icalendar-first-weekday-of-year ABBREVWEEKDAY YEAR)

Documentation

Find the first ABBREVWEEKDAY in a given YEAR.

Returns day number.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/icalendar.el.gz
(defun icalendar-first-weekday-of-year (abbrevweekday year)
  "Find the first ABBREVWEEKDAY in a given YEAR.
Returns day number."
  (let* ((day-of-week-jan01 (calendar-day-of-week (list 1 1 year)))
         (result (+ 1
                    (- (icalendar--get-weekday-number abbrevweekday)
                       day-of-week-jan01))))
    (cond ((<= result 0)
           (setq result (+ result 7)))
          ((> result 7)
           (setq result (- result 7))))
    result))