Function: org-duration-h:mm-only-p

org-duration-h:mm-only-p is an autoloaded and byte-compiled function defined in org-duration.el.gz.

Signature

(org-duration-h:mm-only-p TIMES)

Documentation

Non-nil when every duration in TIMES has "H:MM" or "H:MM:SS" format.

TIMES is a list of duration strings.

Return nil if any duration is expressed with units, as defined in org-duration-units. Otherwise, if any duration is expressed with "H:MM:SS" format, return h:mm:ss. Otherwise, return h:mm.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-duration.el.gz
;;;###autoload
(defun org-duration-h:mm-only-p (times)
  "Non-nil when every duration in TIMES has \"H:MM\" or \"H:MM:SS\" format.

TIMES is a list of duration strings.

Return nil if any duration is expressed with units, as defined in
`org-duration-units'.  Otherwise, if any duration is expressed
with \"H:MM:SS\" format, return `h:mm:ss'.  Otherwise, return
`h:mm'."
  (let (hms-flag)
    (catch :exit
      (dolist (time times)
	(cond ((string-match-p org-duration--full-re time)
	       (throw :exit nil))
	      ((string-match-p org-duration--mixed-re time)
	       (throw :exit nil))
	      (hms-flag nil)
	      ((string-match-p org-duration--h:mm:ss-re time)
	       (setq hms-flag 'h:mm:ss))))
      (or hms-flag 'h:mm))))