]> git.eshelyaron.com Git - emacs.git/commitdiff
; Use more decoded time accessors in time-date.el
authorBasil L. Contovounesios <contovob@tcd.ie>
Thu, 1 Aug 2019 11:07:18 +0000 (14:07 +0300)
committerBasil L. Contovounesios <contovob@tcd.ie>
Thu, 1 Aug 2019 11:07:18 +0000 (14:07 +0300)
These were overlooked in a recent change.
* lisp/calendar/time-date.el (time-date--day-in-year): Use decoded
time accessors.

lisp/calendar/time-date.el

index 32ba1286895eda41f12e5ee3f4e6bfcb30480086..5b82b8ab0fabcb4ca34ea8593dd6cc1fae3661df 100644 (file)
@@ -216,9 +216,9 @@ DATE1 and DATE2 should be date-time strings."
 
 (defun time-date--day-in-year (tim)
   "Return the day number within the year corresponding to the decoded time TIM."
-  (let* ((month (nth 4 tim))
-        (day (nth 3 tim))
-        (year (nth 5 tim))
+  (let* ((month (decoded-time-month tim))
+         (day (decoded-time-day tim))
+         (year (decoded-time-year tim))
         (day-of-year (+ day (* 31 (1- month)))))
     (when (> month 2)
       (setq day-of-year (- day-of-year (/ (+ 23 (* 4 month)) 10)))