changeset 36947:d5d10d387722

Since the Baha'i calendar begins at 0, had to backdate the beginning by 1.
author John Wiegley <johnw@newartisans.com>
date Fri, 23 Mar 2001 02:51:44 +0000
parents adb0272e7b25
children fabff5d240fb
files lisp/calendar/cal-bahai.el
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/cal-bahai.el	Fri Mar 23 02:24:33 2001 +0000
+++ b/lisp/calendar/cal-bahai.el	Fri Mar 23 02:51:44 2001 +0000
@@ -61,15 +61,15 @@
    "Asma" "`Izzat" "Mashiyyat" "`Ilm" "Qudrat" "Qawl" "Masa'il"
    "Sharaf" "Sultan" "Mulk" "`Ala"])
 
-(defvar calendar-bahai-epoch (calendar-absolute-from-gregorian '(3 21 1844))
+(defvar calendar-bahai-epoch (calendar-absolute-from-gregorian '(3 21 1843))
   "Absolute date of start of Baha'i calendar = March 19, 622 A.D. (Julian).")
 
 (defun bahai-calendar-leap-year-p (year)
   "True if YEAR is a leap year on the Baha'i calendar."
-  (calendar-leap-year-p (+ year 1844)))
+  (calendar-leap-year-p (+ year 1843)))
 
 (defvar bahai-calendar-leap-base
-  (+ (/ 1844 4) (- (/ 1844 100)) (/ 1844 400)))
+  (+ (/ 1843 4) (- (/ 1843 100)) (/ 1843 400)))
 
 (defun calendar-absolute-from-bahai (date)
   "Compute absolute date from Baha'i date DATE.
@@ -78,7 +78,7 @@
   (let* ((month (extract-calendar-month date))
 	 (day (extract-calendar-day date))
 	 (year (extract-calendar-year date))
-	 (prior-years (+ (1- year) 1844))
+	 (prior-years (+ (1- year) 1843))
 	 (leap-days (- (+ (/ prior-years 4) ; Leap days in prior years.
 			  (- (/ prior-years 100))
 			  (/ prior-years 400))
@@ -95,7 +95,7 @@
   (if (< date calendar-bahai-epoch)
       (list 0 0 0) ;; pre-Baha'i date
     (let* ((greg (calendar-gregorian-from-absolute date))
-	   (year (+ (- (extract-calendar-year greg) 1844)
+	   (year (+ (- (extract-calendar-year greg) 1843)
 		    (if (or (> (extract-calendar-month greg) 3)
 			    (and (= (extract-calendar-month greg) 3)
 				 (>= (extract-calendar-day greg) 21)))