comparison lisp/calendar/cal-china.el @ 92989:130c0da046a4

(calendar-chinese-from-absolute, calendar-chinese-date-string): Expand calendar-mod calls.
author Glenn Morris <rgm@gnu.org>
date Sun, 16 Mar 2008 01:23:25 +0000
parents 4151ef80cb37
children 9144c487a567
comparison
equal deleted inserted replaced
92988:189ca7ef805d 92989:130c0da046a4
378 ;; Second month on list is a new Chinese year... 378 ;; Second month on list is a new Chinese year...
379 (setq c-year (1+ c-year))) 379 (setq c-year (1+ c-year)))
380 ;; ...so first month on list is of no interest. 380 ;; ...so first month on list is of no interest.
381 (setq list (cdr list))) 381 (setq list (cdr list)))
382 (list (/ (1- c-year) 60) 382 (list (/ (1- c-year) 60)
383 (calendar-mod c-year 60) 383 ;; Remainder of c-year/60 with 60 instead of 0.
384 (1+ (mod (1- c-year) 60))
384 (caar list) 385 (caar list)
385 (1+ (- date (cadr (car list))))))) 386 (1+ (- date (cadr (car list)))))))
386 387
387 ;; Bound in generate-calendar. 388 ;; Bound in generate-calendar.
388 (defvar displayed-month) 389 (defvar displayed-month)
418 (this-month (calendar-absolute-from-chinese 419 (this-month (calendar-absolute-from-chinese
419 (list cycle year month 1))) 420 (list cycle year month 1)))
420 (next-month (calendar-absolute-from-chinese 421 (next-month (calendar-absolute-from-chinese
421 (list (if (= year 60) (1+ cycle) cycle) 422 (list (if (= year 60) (1+ cycle) cycle)
422 (if (= (floor month) 12) (1+ year) year) 423 (if (= (floor month) 12) (1+ year) year)
423 (calendar-mod (1+ (floor month)) 12) 424 ;; Remainder of (1+(floor month))/12, with
425 ;; 12 instead of 0.
426 (1+ (mod (floor month) 12))
424 1))) 427 1)))
425 (m-cycle (% (+ (* year 5) (floor month)) 60))) 428 (m-cycle (% (+ (* year 5) (floor month)) 60)))
426 (format "Cycle %s, year %s (%s), %smonth %s%s, day %s (%s)" 429 (format "Cycle %s, year %s (%s), %smonth %s%s, day %s (%s)"
427 cycle 430 cycle
428 year (calendar-chinese-sexagesimal-name year) 431 year (calendar-chinese-sexagesimal-name year)