From 0c80d3bee62df9a4bc8a3eb99a5feebb1296ed31 Mon Sep 17 00:00:00 2001 From: Ilya Chernyshov Date: Sat, 20 Sep 2025 17:31:04 +0700 Subject: [PATCH] decoded-time-add: Use 'floor' * lisp/calendar/time-date.el (decoded-time-add): Use 'floor' to count new year field value. Copyright-paperwork-exempt: yes --- lisp/calendar/time-date.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index 01f96305edb..9041b04ae62 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -547,7 +547,7 @@ changes in daylight saving time are not taken into account." (when (decoded-time-month delta) (let ((new (+ (1- (decoded-time-month time)) (decoded-time-month delta)))) (setf (decoded-time-month time) (1+ (mod new 12))) - (incf (decoded-time-year time) (- (/ new 12) (if (< new 0) 1 0))))) + (incf (decoded-time-year time) (floor new 12)))) ;; Adjust for month length (as described in the doc string). (setf (decoded-time-day time)