Function: calendar-bahai-date-string
calendar-bahai-date-string is an autoloaded and byte-compiled function
defined in cal-bahai.el.gz.
Signature
(calendar-bahai-date-string &optional DATE)
Documentation
String of Bahá’í date of Gregorian DATE.
Defaults to today's date if DATE is not given.
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/cal-bahai.el.gz
;;;###cal-autoload
(defun calendar-bahai-date-string (&optional date)
"String of Bahá’í date of Gregorian DATE.
Defaults to today's date if DATE is not given."
(let* ((bahai-date (calendar-bahai-from-absolute
(calendar-absolute-from-gregorian
(or date (calendar-current-date)))))
(y (calendar-extract-year bahai-date)))
(if (< y 1)
"" ; pre-Bahai
(let ((m (calendar-extract-month bahai-date))
(d (calendar-extract-day bahai-date)))
(calendar-dlet
((monthname (if (and (= m 19)
(<= d 0))
"Ayyám-i-Há"
(aref calendar-bahai-month-name-array (1- m))))
(day (number-to-string
(if (<= d 0)
(+ d (if (calendar-bahai-leap-year-p y) 5 4))
d)))
(year (number-to-string y))
(month (number-to-string m))
dayname)
;; Can't call calendar-date-string because of monthname oddity.
(mapconcat #'eval calendar-date-display-form ""))))))