Browse Source

Backport commit e0ca8f791 from Emacs

* lisp/ox-icalendar.el (org-icalendar-template)
(org-icalendar-export-current-agenda)
(org-icalendar--combine-files):
Prefer (format-time-string "%Z") to (cadr (current-time-zone)).

Prefer format-time-string to current-time-zone
e0ca8f791c2e4396f1e40d86c136ae547b40185d
Paul Eggert
Thu Dec 16 11:17:26 2021 -0800

[ km: The org-icalendar--combine-files change has a typo that will be
  fixed in a follow-up commit. ]
Paul Eggert 3 years ago
parent
commit
659646f135
1 changed files with 3 additions and 4 deletions
  1. 3 4
      lisp/ox-icalendar.el

+ 3 - 4
lisp/ox-icalendar.el

@@ -824,8 +824,7 @@ as a communication channel."
    (if (not (plist-get info :with-author)) ""
      (org-export-data (plist-get info :author) info))
    ;; Timezone.
-   (if (org-string-nw-p org-icalendar-timezone) org-icalendar-timezone
-     (cadr (current-time-zone)))
+   (or (org-string-nw-p org-icalendar-timezone) (format-time-string "%Z"))
    ;; Description.
    (org-export-data (plist-get info :title) info)
    contents))
@@ -972,7 +971,7 @@ This function assumes major mode for current buffer is
        (org-icalendar--vcalendar
 	org-icalendar-combined-name
 	user-full-name
-	(or (org-string-nw-p org-icalendar-timezone) (cadr (current-time-zone)))
+	(or (org-string-nw-p org-icalendar-timezone) (format-time-string "%Z"))
 	org-icalendar-combined-description
 	contents)))
     (run-hook-with-args 'org-icalendar-after-save-hook file)))
@@ -995,7 +994,7 @@ FILES is a list of files to build the calendar from."
 	      user-full-name
 	      ;; Timezone.
 	      (or (org-string-nw-p org-icalendar-timezone)
-		  (cadr (current-time-zone)))
+		  (format-time-string "Z"))
 	      ;; Description.
 	      org-icalendar-combined-description
 	      ;; Contents.