From 3dc7dad23add129340e7179e12bc12cc82d07001 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sat, 17 Nov 2012 15:34:09 -0600 Subject: [PATCH] * calc/calc-forms.el (calc-gregorian-switch): Declare. --- lisp/calc/calc-forms.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index 4573377745c..c1f6d03db80 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -520,7 +520,7 @@ use the Gregorian calendar." "Return the number of days of the year up to YEAR MONTH DAY. The count includes the given date." (if calc-gregorian-switch - (cond ((math-equalp year (nth 0 calc-gregorian-switch)) + (cond ((eq year (nth 0 calc-gregorian-switch)) (1+ (- (math-absolute-from-dt year month day) (math-absolute-from-dt year 1 1)))) @@ -587,6 +587,10 @@ in the Gregorian calendar." ;; Adjustment, since January 1, 1 (Julian) is absolute day -1 2))) +;; calc-gregorian-switch is a customizable variable defined in calc.el +(defvar calc-gregorian-switch) + + (defun math-absolute-from-dt (year month day) "Return the DATE of the day given by the day YEAR MONTH DAY. Recall that DATE is the number of days since December 31, -1 -- 2.39.5