changeset 93440:6181940a6360

(calendar-bahai-date-string): Avoid an error for pre-Bahai dates.
author Glenn Morris <rgm@gnu.org>
date Mon, 31 Mar 2008 01:47:11 +0000
parents 54e6e607f482
children c13d8b4cc7ad
files lisp/calendar/cal-bahai.el
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/cal-bahai.el	Mon Mar 31 01:36:40 2008 +0000
+++ b/lisp/calendar/cal-bahai.el	Mon Mar 31 01:47:11 2008 +0000
@@ -126,8 +126,9 @@
          (y (extract-calendar-year bahai-date))
          (m (extract-calendar-month bahai-date))
          (d (extract-calendar-day bahai-date))
-         (monthname (if (and (= m 19)
-                             (<= d 0))
+         (monthname (if (or (< m 1)     ; pre-Bahai, avoid aref error
+                            (and (= m 19)
+                                 (<= d 0)))
                         "Ayyám-i-Há"
                       (aref calendar-bahai-month-name-array (1- m))))
          (day (int-to-string
@@ -195,6 +196,7 @@
 (defvar displayed-month)
 (defvar displayed-year)
 
+;; FIXME same as islamic.
 ;;;###holiday-autoload
 (defun holiday-bahai (month day string)
   "Holiday on MONTH, DAY (Bahá'í) called STRING.
@@ -208,6 +210,8 @@
          (y (extract-calendar-year bahai-date))
          date)
     (unless (< m 1)                    ; Bahá'í calendar doesn't apply
+      ;; FIXME makes no sense (?), since there are not 12 months in a year.
+      ;; Suspect this was copied from cal-islam.
       (increment-calendar-month m y (- 10 month))
       (if (> m 7)                       ; Bahá'í date might be visible
           (let ((date (calendar-gregorian-from-absolute