Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
799fc921
Commit
799fc921
authored
Mar 23, 2001
by
John Wiegley
Browse files
Since the Baha'i calendar begins at 0, had to backdate the beginning
by 1.
parent
ec7a10e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
lisp/calendar/cal-bahai.el
lisp/calendar/cal-bahai.el
+5
-5
No files found.
lisp/calendar/cal-bahai.el
View file @
799fc921
...
...
@@ -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
184
4
))
(
defvar
calendar-bahai-epoch
(
calendar-absolute-from-gregorian
'
(
3
21
184
3
))
"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
184
4
)))
(
calendar-leap-year-p
(
+
year
184
3
)))
(
defvar
bahai-calendar-leap-base
(
+
(
/
184
4
4
)
(
-
(
/
184
4
100
))
(
/
184
4
400
)))
(
+
(
/
184
3
4
)
(
-
(
/
184
3
100
))
(
/
184
3
400
)))
(
defun
calendar-absolute-from-bahai
(
date
)
"Compute absolute date from Baha'i date DATE.
...
...
@@ -78,7 +78,7 @@ Gregorian date Sunday, December 31, 1 BC."
(
let*
((
month
(
extract-calendar-month
date
))
(
day
(
extract-calendar-day
date
))
(
year
(
extract-calendar-year
date
))
(
prior-years
(
+
(
1-
year
)
184
4
))
(
prior-years
(
+
(
1-
year
)
184
3
))
(
leap-days
(
-
(
+
(
/
prior-years
4
)
; Leap days in prior years.
(
-
(
/
prior-years
100
))
(
/
prior-years
400
))
...
...
@@ -95,7 +95,7 @@ Gregorian date Sunday, December 31, 1 BC."
(
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
)
184
4
)
(
year
(
+
(
-
(
extract-calendar-year
greg
)
184
3
)
(
if
(
or
(
>
(
extract-calendar-month
greg
)
3
)
(
and
(
=
(
extract-calendar-month
greg
)
3
)
(
>=
(
extract-calendar-day
greg
)
21
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment