summaryrefslogtreecommitdiff
path: root/lisp/calendar/cal-china.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2008-03-16 01:23:25 +0000
committerGlenn Morris <rgm@gnu.org>2008-03-16 01:23:25 +0000
commitc97663f6bc5154ae3eb3c959c40af21ce9578a7a (patch)
tree1f56715058cdc5a06751e81c82d890d5fc5b3a6b /lisp/calendar/cal-china.el
parentdf3b40c18cb641f3221696720cacf700efdbcef0 (diff)
downloademacs-c97663f6bc5154ae3eb3c959c40af21ce9578a7a.tar.gz
(calendar-chinese-from-absolute, calendar-chinese-date-string): Expand
calendar-mod calls.
Diffstat (limited to 'lisp/calendar/cal-china.el')
-rw-r--r--lisp/calendar/cal-china.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/calendar/cal-china.el b/lisp/calendar/cal-china.el
index f66645e918b..69aa91f2137 100644
--- a/lisp/calendar/cal-china.el
+++ b/lisp/calendar/cal-china.el
@@ -380,7 +380,8 @@ Gregorian date Sunday, December 31, 1 BC."
;; ...so first month on list is of no interest.
(setq list (cdr list)))
(list (/ (1- c-year) 60)
- (calendar-mod c-year 60)
+ ;; Remainder of c-year/60 with 60 instead of 0.
+ (1+ (mod (1- c-year) 60))
(caar list)
(1+ (- date (cadr (car list)))))))
@@ -420,7 +421,9 @@ Defaults to today's date if DATE is not given."
(next-month (calendar-absolute-from-chinese
(list (if (= year 60) (1+ cycle) cycle)
(if (= (floor month) 12) (1+ year) year)
- (calendar-mod (1+ (floor month)) 12)
+ ;; Remainder of (1+(floor month))/12, with
+ ;; 12 instead of 0.
+ (1+ (mod (floor month) 12))
1)))
(m-cycle (% (+ (* year 5) (floor month)) 60)))
(format "Cycle %s, year %s (%s), %smonth %s%s, day %s (%s)"