aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Wiegley2001-03-23 02:51:44 +0000
committerJohn Wiegley2001-03-23 02:51:44 +0000
commit799fc921d7bbf0f2e085e393a887bc065ec231d2 (patch)
tree103f983498bac6aca80772b872bb90de81efbaf2
parentec7a10e346db4d78c2d15d7d1e226e98bb337b82 (diff)
downloademacs-799fc921d7bbf0f2e085e393a887bc065ec231d2.tar.gz
emacs-799fc921d7bbf0f2e085e393a887bc065ec231d2.zip
Since the Baha'i calendar begins at 0, had to backdate the beginning
by 1.
-rw-r--r--lisp/calendar/cal-bahai.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/calendar/cal-bahai.el b/lisp/calendar/cal-bahai.el
index 24486b7cae2..22ab6ef0883 100644
--- a/lisp/calendar/cal-bahai.el
+++ b/lisp/calendar/cal-bahai.el
@@ -61,15 +61,15 @@
61 "Asma" "`Izzat" "Mashiyyat" "`Ilm" "Qudrat" "Qawl" "Masa'il" 61 "Asma" "`Izzat" "Mashiyyat" "`Ilm" "Qudrat" "Qawl" "Masa'il"
62 "Sharaf" "Sultan" "Mulk" "`Ala"]) 62 "Sharaf" "Sultan" "Mulk" "`Ala"])
63 63
64(defvar calendar-bahai-epoch (calendar-absolute-from-gregorian '(3 21 1844)) 64(defvar calendar-bahai-epoch (calendar-absolute-from-gregorian '(3 21 1843))
65 "Absolute date of start of Baha'i calendar = March 19, 622 A.D. (Julian).") 65 "Absolute date of start of Baha'i calendar = March 19, 622 A.D. (Julian).")
66 66
67(defun bahai-calendar-leap-year-p (year) 67(defun bahai-calendar-leap-year-p (year)
68 "True if YEAR is a leap year on the Baha'i calendar." 68 "True if YEAR is a leap year on the Baha'i calendar."
69 (calendar-leap-year-p (+ year 1844))) 69 (calendar-leap-year-p (+ year 1843)))
70 70
71(defvar bahai-calendar-leap-base 71(defvar bahai-calendar-leap-base
72 (+ (/ 1844 4) (- (/ 1844 100)) (/ 1844 400))) 72 (+ (/ 1843 4) (- (/ 1843 100)) (/ 1843 400)))
73 73
74(defun calendar-absolute-from-bahai (date) 74(defun calendar-absolute-from-bahai (date)
75 "Compute absolute date from Baha'i date DATE. 75 "Compute absolute date from Baha'i date DATE.
@@ -78,7 +78,7 @@ Gregorian date Sunday, December 31, 1 BC."
78 (let* ((month (extract-calendar-month date)) 78 (let* ((month (extract-calendar-month date))
79 (day (extract-calendar-day date)) 79 (day (extract-calendar-day date))
80 (year (extract-calendar-year date)) 80 (year (extract-calendar-year date))
81 (prior-years (+ (1- year) 1844)) 81 (prior-years (+ (1- year) 1843))
82 (leap-days (- (+ (/ prior-years 4) ; Leap days in prior years. 82 (leap-days (- (+ (/ prior-years 4) ; Leap days in prior years.
83 (- (/ prior-years 100)) 83 (- (/ prior-years 100))
84 (/ prior-years 400)) 84 (/ prior-years 400))
@@ -95,7 +95,7 @@ Gregorian date Sunday, December 31, 1 BC."
95 (if (< date calendar-bahai-epoch) 95 (if (< date calendar-bahai-epoch)
96 (list 0 0 0) ;; pre-Baha'i date 96 (list 0 0 0) ;; pre-Baha'i date
97 (let* ((greg (calendar-gregorian-from-absolute date)) 97 (let* ((greg (calendar-gregorian-from-absolute date))
98 (year (+ (- (extract-calendar-year greg) 1844) 98 (year (+ (- (extract-calendar-year greg) 1843)
99 (if (or (> (extract-calendar-month greg) 3) 99 (if (or (> (extract-calendar-month greg) 3)
100 (and (= (extract-calendar-month greg) 3) 100 (and (= (extract-calendar-month greg) 3)
101 (>= (extract-calendar-day greg) 21))) 101 (>= (extract-calendar-day greg) 21)))