Function: calendar-last-day-of-month

calendar-last-day-of-month is a byte-compiled function defined in calendar.el.gz.

Signature

(calendar-last-day-of-month MONTH YEAR)

Documentation

The last day in MONTH during YEAR.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/calendar.el.gz
;; The foregoing is a bit faster, but not as clear as the following:
;;
;;(defsubst calendar-leap-year-p (year)
;;  "Return t if YEAR is a Gregorian leap year."
;;  (or
;;   (and (zerop (% year 4))
;;        (not (zerop (% year 100))))
;;   (zerop (% year 400)))

(defsubst calendar-last-day-of-month (month year)
  "The last day in MONTH during YEAR."
  (if (and (= month 2) (calendar-leap-year-p year))
      29
    (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- month))))