Mercurial > emacs
comparison lisp/calendar/cal-china.el @ 13675:280cee006df8
(calendar-chinese-sexagesimal-name): Renamed from
calendar-chinese-sexagisimal-name to fix misspelling.
author | Paul Eggert <eggert@twinsun.com> |
---|---|
date | Thu, 30 Nov 1995 03:25:04 +0000 |
parents | c5d4269e17d9 |
children | 83f275dcd93a |
comparison
equal
deleted
inserted
replaced
13674:67da41b74267 | 13675:280cee006df8 |
---|---|
323 (car (cdr (assoc 1 (chinese-year y))))))) | 323 (car (cdr (assoc 1 (chinese-year y))))))) |
324 (if (calendar-date-is-visible-p chinese-new-year) | 324 (if (calendar-date-is-visible-p chinese-new-year) |
325 (list | 325 (list |
326 (list chinese-new-year | 326 (list chinese-new-year |
327 (format "Chinese New Year (%s)" | 327 (format "Chinese New Year (%s)" |
328 (calendar-chinese-sexagisimal-name (+ y 57)))))))))) | 328 (calendar-chinese-sexagesimal-name (+ y 57)))))))))) |
329 | 329 |
330 (defun calendar-chinese-date-string (&optional date) | 330 (defun calendar-chinese-date-string (&optional date) |
331 "String of Chinese date of Gregorian DATE. | 331 "String of Chinese date of Gregorian DATE. |
332 Defaults to today's date if DATE is not given." | 332 Defaults to today's date if DATE is not given." |
333 (let* ((a-date (calendar-absolute-from-gregorian | 333 (let* ((a-date (calendar-absolute-from-gregorian |
345 (calendar-mod (1+ (floor month)) 12) | 345 (calendar-mod (1+ (floor month)) 12) |
346 1))) | 346 1))) |
347 (m-cycle (% (+ (* year 5) (floor month)) 60))) | 347 (m-cycle (% (+ (* year 5) (floor month)) 60))) |
348 (format "Cycle %s, year %s (%s), %smonth %s%s, day %s (%s)" | 348 (format "Cycle %s, year %s (%s), %smonth %s%s, day %s (%s)" |
349 cycle | 349 cycle |
350 year (calendar-chinese-sexagisimal-name year) | 350 year (calendar-chinese-sexagesimal-name year) |
351 (if (not (integerp month)) | 351 (if (not (integerp month)) |
352 "second " | 352 "second " |
353 (if (< 30 (- next-month this-month)) | 353 (if (< 30 (- next-month this-month)) |
354 "first " | 354 "first " |
355 "")) | 355 "")) |
356 (floor month) | 356 (floor month) |
357 (if (integerp month) | 357 (if (integerp month) |
358 (format " (%s)" (calendar-chinese-sexagisimal-name | 358 (format " (%s)" (calendar-chinese-sexagesimal-name |
359 (+ (* 5 year) month 44))) | 359 (+ (* 5 year) month 44))) |
360 "") | 360 "") |
361 day (calendar-chinese-sexagisimal-name (+ a-date 15))))) | 361 day (calendar-chinese-sexagesimal-name (+ a-date 15))))) |
362 | 362 |
363 (defun calendar-chinese-sexagisimal-name (n) | 363 (defun calendar-chinese-sexagesimal-name (n) |
364 "The N-th name of the Chinese sexagisimal cycle. | 364 "The N-th name of the Chinese sexagesimal cycle. |
365 N congruent to 1 gives the first name, N congruent to 2 gives the second name, | 365 N congruent to 1 gives the first name, N congruent to 2 gives the second name, |
366 ..., N congruent to 60 gives the sixtieth name." | 366 ..., N congruent to 60 gives the sixtieth name." |
367 (format "%s-%s" | 367 (format "%s-%s" |
368 (aref chinese-calendar-celestial-stem (% (1- n) 10)) | 368 (aref chinese-calendar-celestial-stem (% (1- n) 10)) |
369 (aref chinese-calendar-terrestrial-branch (% (1- n) 12)))) | 369 (aref chinese-calendar-terrestrial-branch (% (1- n) 12)))) |