From: Jay Belanger Date: Sat, 17 Nov 2012 21:34:09 +0000 (-0600) Subject: * calc/calc-forms.el (calc-gregorian-switch): Declare. X-Git-Tag: emacs-24.3.90~173^2~18^2~75 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3dc7dad23add129340e7179e12bc12cc82d07001;p=emacs.git * calc/calc-forms.el (calc-gregorian-switch): Declare. --- 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