diff options
| author | Edward M. Reingold | 1995-10-26 22:38:23 +0000 |
|---|---|---|
| committer | Edward M. Reingold | 1995-10-26 22:38:23 +0000 |
| commit | b4cb70c40cd2817909e6d39fa62cf1a8e7748289 (patch) | |
| tree | 39022f95828b3799a50d9be56f65f7fba7c8e125 | |
| parent | 3635be47bdc67ae98851c030656339b31d7ba660 (diff) | |
| download | emacs-b4cb70c40cd2817909e6d39fa62cf1a8e7748289.tar.gz emacs-b4cb70c40cd2817909e6d39fa62cf1a8e7748289.zip | |
Fix the way the sexagisimal names are calculated.
| -rw-r--r-- | lisp/calendar/cal-china.el | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/lisp/calendar/cal-china.el b/lisp/calendar/cal-china.el index 3df879a930a..3c6b8d265f2 100644 --- a/lisp/calendar/cal-china.el +++ b/lisp/calendar/cal-china.el | |||
| @@ -319,12 +319,10 @@ Gregorian date Sunday, December 31, 1 BC." | |||
| 319 | (calendar-gregorian-from-absolute | 319 | (calendar-gregorian-from-absolute |
| 320 | (cdr (assoc 1 (chinese-year y)))))) | 320 | (cdr (assoc 1 (chinese-year y)))))) |
| 321 | (if (calendar-date-is-visible-p chinese-new-year) | 321 | (if (calendar-date-is-visible-p chinese-new-year) |
| 322 | (list (list chinese-new-year | 322 | (list |
| 323 | (format "Chinese New Year (%s-%s)" | 323 | (list chinese-new-year |
| 324 | (aref chinese-calendar-celestial-stem | 324 | (format "Chinese New Year (%s)" |
| 325 | (% (+ y 6) 10)) | 325 | (calendar-chinese-sexagisimal-name (+ y 57)))))))))) |
| 326 | (aref chinese-calendar-terrestrial-branch | ||
| 327 | (% (+ y 8) 12)))))))))) | ||
| 328 | 326 | ||
| 329 | (defun calendar-chinese-date-string (&optional date) | 327 | (defun calendar-chinese-date-string (&optional date) |
| 330 | "String of Chinese date of Gregorian DATE. | 328 | "String of Chinese date of Gregorian DATE. |
| @@ -344,20 +342,28 @@ Defaults to today's date if DATE is not given." | |||
| 344 | (calendar-mod (1+ (floor month)) 12) | 342 | (calendar-mod (1+ (floor month)) 12) |
| 345 | 1))) | 343 | 1))) |
| 346 | (m-cycle (% (+ (* year 5) (floor month)) 60))) | 344 | (m-cycle (% (+ (* year 5) (floor month)) 60))) |
| 347 | (format "Cycle %s, year %s (%s-%s), %smonth %s, day %s (%s-%s)" | 345 | (format "Cycle %s, year %s (%s), %smonth %s%s, day %s (%s)" |
| 348 | cycle | 346 | cycle |
| 349 | year | 347 | year (calendar-chinese-sexagisimal-name year) |
| 350 | (aref chinese-calendar-celestial-stem (% (+ year 9) 10)) | ||
| 351 | (aref chinese-calendar-terrestrial-branch (% (+ year 11) 12)) | ||
| 352 | (if (not (integerp month)) | 348 | (if (not (integerp month)) |
| 353 | "second " | 349 | "second " |
| 354 | (if (< 30 (- next-month this-month)) | 350 | (if (< 30 (- next-month this-month)) |
| 355 | "first " | 351 | "first " |
| 356 | "")) | 352 | "")) |
| 357 | (floor month) | 353 | (floor month) |
| 358 | day | 354 | (if (integerp month) |
| 359 | (aref chinese-calendar-celestial-stem (% (+ a-date 4) 10)) | 355 | (format " (%s)" (calendar-chinese-sexagisimal-name |
| 360 | (aref chinese-calendar-terrestrial-branch (% (+ a-date 2) 12))))) | 356 | (+ (* 5 year) month 44))) |
| 357 | "") | ||
| 358 | day (calendar-chinese-sexagisimal-name (+ a-date 15))))) | ||
| 359 | |||
| 360 | (defun calendar-chinese-sexagisimal-name (n) | ||
| 361 | "The N-th name of the Chinese sexagisimal cycle. | ||
| 362 | N congruent to 1 gives the first name, N congruent to 2 gives the second name, | ||
| 363 | ..., N congruent to 60 gives the sixtieth name." | ||
| 364 | (format "%s-%s" | ||
| 365 | (aref chinese-calendar-celestial-stem (% (1- n) 10)) | ||
| 366 | (aref chinese-calendar-terrestrial-branch (% (1- n) 12)))) | ||
| 361 | 367 | ||
| 362 | (defun calendar-print-chinese-date () | 368 | (defun calendar-print-chinese-date () |
| 363 | "Show the Chinese date equivalents of date." | 369 | "Show the Chinese date equivalents of date." |