Commit 0d16be53 authored by Glenn Morris's avatar Glenn Morris
Browse files

(holiday-chinese-new-year): Doc fix and comment.

parent a0e08467
......@@ -421,19 +421,25 @@ Gregorian date Sunday, December 31, 1 BC."
(defun holiday-chinese-new-year ()
"Date of Chinese New Year."
"Date of Chinese New Year, if visible in calendar.
Returns (((MONTH DAY YEAR) TEXT)), where the date is Gregorian."
(let ((m displayed-month)
(y displayed-year))
(increment-calendar-month m y 1)
;; In the Gregorian calendar, CNY falls between Jan 21 and Feb 20.
;; Jan is visible if displayed-month = 12, 1, 2; Feb if d-m = 1, 2, 3.
;; If we shift the calendar forward one month, we can do a
;; one-sided test, namely: d-m <= 4 means CNYN might be visible.
(increment-calendar-month m y 1) ; shift forward a month
(if (< m 5)
(let ((chinese-new-year
(cadr (assoc 1 (chinese-year y))))))
(if (calendar-date-is-visible-p chinese-new-year)
(list chinese-new-year
(format "Chinese New Year (%s)"
(calendar-chinese-sexagesimal-name (+ y 57))))))))))
(list chinese-new-year
(format "Chinese New Year (%s)"
(+ y 57))))))))))
(defun calendar-chinese-date-string (&optional date)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment