Function: icalendar-vtimezone-validator

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

Signature

(icalendar-vtimezone-validator NODE)

Documentation

Additional validator for an icalendar-vtimezone NODE.

Checks that NODE has at least one icalendar-standard or icalendar-daylight child.

This function is called by icalendar-ast-node-valid-p for VTIMEZONE nodes; it is not normally necessary to call it directly.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/icalendar-parser.el.gz
(defun ical:vtimezone-validator (node)
  "Additional validator for an `icalendar-vtimezone' NODE.
Checks that NODE has at least one `icalendar-standard' or
`icalendar-daylight' child.

This function is called by `icalendar-ast-node-valid-p' for
VTIMEZONE nodes; it is not normally necessary to call it directly."
  (let ((child-counts (ical:count-children-by-type node)))
    (when (and (= 0 (alist-get 'ical:standard child-counts 0))
               (= 0 (alist-get 'ical:daylight child-counts 0)))
      (ical:signal-validation-error
       (concat "`icalendar-vtimezone' must have at least one "
               "`icalendar-standard' or `icalendar-daylight' child")
       :node node)))

  ;; success:
  node)