diff options
| author | Ilya Chernyshov | 2025-09-20 17:31:04 +0700 |
|---|---|---|
| committer | Sean Whitton | 2025-10-07 16:35:41 +0100 |
| commit | 0c80d3bee62df9a4bc8a3eb99a5feebb1296ed31 (patch) | |
| tree | 9639f2d6740ca2091f0387fca03631d0177bad16 | |
| parent | 7f925b06ace3435d6527aabf345165a7116b241d (diff) | |
| download | emacs-0c80d3bee62df9a4bc8a3eb99a5feebb1296ed31.tar.gz emacs-0c80d3bee62df9a4bc8a3eb99a5feebb1296ed31.zip | |
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
| -rw-r--r-- | lisp/calendar/time-date.el | 2 |
1 files changed, 1 insertions, 1 deletions
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." | |||
| 547 | (when (decoded-time-month delta) | 547 | (when (decoded-time-month delta) |
| 548 | (let ((new (+ (1- (decoded-time-month time)) (decoded-time-month delta)))) | 548 | (let ((new (+ (1- (decoded-time-month time)) (decoded-time-month delta)))) |
| 549 | (setf (decoded-time-month time) (1+ (mod new 12))) | 549 | (setf (decoded-time-month time) (1+ (mod new 12))) |
| 550 | (incf (decoded-time-year time) (- (/ new 12) (if (< new 0) 1 0))))) | 550 | (incf (decoded-time-year time) (floor new 12)))) |
| 551 | 551 | ||
| 552 | ;; Adjust for month length (as described in the doc string). | 552 | ;; Adjust for month length (as described in the doc string). |
| 553 | (setf (decoded-time-day time) | 553 | (setf (decoded-time-day time) |