Function: math-parse-iso-date-validate

math-parse-iso-date-validate is a byte-compiled function defined in calc-forms.el.gz.

Signature

(math-parse-iso-date-validate ISOYEAR ISOWEEK ISOWEEKDAY HOUR MINUTE SECOND)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-forms.el.gz
(defun math-parse-iso-date-validate (isoyear isoweek isoweekday hour minute second)
  (if (or (< isoweek 1) (> isoweek 53))
      (throw 'syntax "Week value is out of range"))
  (if (or (< isoweekday 1) (> isoweekday 7))
      (throw 'syntax "Weekday value is out of range"))
  (and hour
       (progn
	 (if (or (< hour 0)
                 (> hour 24)
                 (and (= hour 24)
                      (not (= minute 0))
                      (not (eq second 0))))
	     (throw 'syntax "Hour value is out of range"))
	 (if (or (< minute 0) (> minute 59))
	     (throw 'syntax "Minute value is out of range"))
	 (if (or (math-negp second) (not (Math-lessp second 60)))
	     (throw 'syntax "Seconds value is out of range"))))
  (list 'date (math-iso-dt-to-date (append (list isoyear isoweek isoweekday)
				       (and hour (list hour minute second))))))