diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2019-07-30 16:46:10 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-07-31 21:47:29 +0200 |
commit | 07ce3be6aa15fdf2092bdf3c60a132d5f4b9c980 (patch) | |
tree | 7c2a4aa87a125476ee7b6ef14713bf2f93c6807f /lisp/calendar/iso8601.el | |
parent | 8c04e65622cbff1417727162d9b0c455cb87ed73 (diff) | |
download | emacs-07ce3be6aa15fdf2092bdf3c60a132d5f4b9c980.tar.gz emacs-07ce3be6aa15fdf2092bdf3c60a132d5f4b9c980.tar.bz2 emacs-07ce3be6aa15fdf2092bdf3c60a132d5f4b9c980.zip |
`decoded-time-set-defaults' refactored out from iso8601 code
* lisp/calendar/iso8601.el (iso8601--encode-time):
* lisp/calendar/time-date.el (decoded-time-set-defaults):
Refactor out from `iso8601--encode-time', because it's helpful
in other contexts.
Diffstat (limited to 'lisp/calendar/iso8601.el')
-rw-r--r-- | lisp/calendar/iso8601.el | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/lisp/calendar/iso8601.el b/lisp/calendar/iso8601.el index ab0077ac58d..c69156cbeb6 100644 --- a/lisp/calendar/iso8601.el +++ b/lisp/calendar/iso8601.el @@ -349,21 +349,7 @@ Return the number of minutes." (defun iso8601--encode-time (time) "Like `encode-time', but fill in nil values in TIME." - (setq time (copy-sequence time)) - (unless (decoded-time-second time) - (setf (decoded-time-second time) 0)) - (unless (decoded-time-minute time) - (setf (decoded-time-minute time) 0)) - (unless (decoded-time-hour time) - (setf (decoded-time-hour time) 0)) - - (unless (decoded-time-day time) - (setf (decoded-time-day time) 1)) - (unless (decoded-time-month time) - (setf (decoded-time-month time) 1)) - (unless (decoded-time-year time) - (setf (decoded-time-year time) 0)) - (encode-time time)) + (encode-time (decoded-time-set-defaults (copy-sequence time)))) (provide 'iso8601) |