Function: icalendar--parse-vtimezone

icalendar--parse-vtimezone is a byte-compiled function defined in icalendar.el.gz.

Signature

(icalendar--parse-vtimezone ALIST)

Documentation

Turn a VTIMEZONE ALIST into a cons (ID . TZ-STRING).

Consider only the most recent date specification. Return nil if timezone cannot be parsed.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/icalendar.el.gz
(defun icalendar--parse-vtimezone (alist)
  "Turn a VTIMEZONE ALIST into a cons (ID . TZ-STRING).
Consider only the most recent date specification.
Return nil if timezone cannot be parsed."
  (let* ((tz-id (icalendar--convert-string-for-import
                 (icalendar--get-event-property alist 'TZID)))
	 (daylight (cadr (cdar (icalendar--get-most-recent-observance alist 'DAYLIGHT))))
	 (day (and daylight (icalendar--convert-tz-offset daylight t)))
	 (standard (cadr (cdar (icalendar--get-most-recent-observance alist 'STANDARD))))
	 (std (and standard (icalendar--convert-tz-offset standard nil))))
    (if (and tz-id std)
	(cons tz-id
	      (if day
		  (concat (car std) (car day)
			  "," (cdr day) "," (cdr std))
		(car std))))))