Function: calendar-bahai-leap-year-p

calendar-bahai-leap-year-p is a byte-compiled function defined in cal-bahai.el.gz.

Signature

(calendar-bahai-leap-year-p YEAR)

Documentation

True if Bahá’í YEAR is a leap year in the Bahá’í calendar.

For years before 172 BE, follows Gregorian leap year pattern. For years from 172 BE onwards, determined by whether Ayyám-i-Há has 5 days based on the gap between successive Naw-Rúz dates.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/cal-bahai.el.gz
(defun calendar-bahai-leap-year-p (year)
  "True if Bahá’í YEAR is a leap year in the Bahá’í calendar.
For years before 172 BE, follows Gregorian leap year pattern.
For years from 172 BE onwards, determined by whether Ayyám-i-Há has 5 days
based on the gap between successive Naw-Rúz dates."
  (if (< year calendar-bahai-reform-year)
      ;; Pre-reform: follows Gregorian pattern
      ;; Ayyám-i-Há of year N falls in Gregorian February of year 1844 + N
      (calendar-leap-year-p (+ year 1844))
    ;; Post-reform: 5 days of Ayyám-i-Há if the gap requires it
    ;; A year has 5 Ayyám-i-Há days if this year's Naw-Rúz to next year's
    ;; Naw-Rúz is 366 days (otherwise 365)
    (let ((this-nawruz (calendar-bahai-nawruz year))
          (next-nawruz (calendar-bahai-nawruz (1+ year))))
      (= (- next-nawruz this-nawruz) 366))))