Function: calendar-month-visible-p

calendar-month-visible-p is a byte-compiled function defined in calendar.el.gz.

Signature

(calendar-month-visible-p MONTH &optional N)

Documentation

Return non-nil if MONTH and next N months are visible in the calendar.

Since the calendar shows at most 12 months, each month, if visible, is associated with only one year. If the optional argument N is omitted or
0, the return value is the year associated with MONTH. Otherwise, the
return value is a list of visible years between MONTH and MONTH+N.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/calendar.el.gz
(defun calendar-month-visible-p (month &optional n)
  "Return non-nil if MONTH and next N months are visible in the calendar.
Since the calendar shows at most 12 months, each month, if visible, is
associated with only one year.  If the optional argument N is omitted or
0, the return value is the year associated with MONTH.  Otherwise, the
return value is a list of visible years between MONTH and MONTH+N."
  (or n (setq n 0))
  (pcase-let ((`(,m1 ,y1 ,m2 ,y2) (calendar-get-month-range))
              (r nil))
    (if (= y1 y2)
        (if (calendar--month-overlap-p m1 m2 month n) (push y1 r))
      (progn
        (if (calendar--month-overlap-p 1  m2 month n) (push y2 r))
        (if (calendar--month-overlap-p m1 12 month n) (push y1 r))))
    (if (zerop n) (car r) r)))