Function: cal-tex-number-weeks

cal-tex-number-weeks is a byte-compiled function defined in cal-tex.el.gz.

Signature

(cal-tex-number-weeks MONTH YEAR N)

Documentation

Determine the number of weeks in a range of dates.

Compute the number of weeks in the calendar starting with MONTH and YEAR, and lasting N months, including only the days in WHICH-DAYS. As it stands, this is only an upper bound.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/cal-tex.el.gz
(defun cal-tex-number-weeks (month year n)
  "Determine the number of weeks in a range of dates.
Compute the number of weeks in the calendar starting with MONTH and YEAR,
and lasting N months, including only the days in WHICH-DAYS.  As it stands,
this is only an upper bound."
  (let ((d (list month 1 year)))
    (calendar-increment-month month year (1- n))
    (/ (- (calendar-dayname-on-or-before
           calendar-week-start-day
           (+ 7 (calendar-absolute-from-gregorian
                   (list month (calendar-last-day-of-month month year) year))))
          (calendar-dayname-on-or-before
           calendar-week-start-day
           (calendar-absolute-from-gregorian d)))
       7)))