Function: org-timer-fix-incomplete

org-timer-fix-incomplete is a byte-compiled function defined in org-timer.el.gz.

Signature

(org-timer-fix-incomplete HMS)

Documentation

If hms is a H:MM:SS string with missing hour or hour and minute, fix it.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-timer.el.gz
(defun org-timer-fix-incomplete (hms)
  "If hms is a H:MM:SS string with missing hour or hour and minute, fix it."
  (if (string-match "\\(?:\\([0-9]+:\\)?\\([0-9]+:\\)\\)?\\([0-9]+\\)" hms)
      (replace-match
       (format "%d:%02d:%02d"
	       (if (match-end 1) (string-to-number (match-string 1 hms)) 0)
	       (if (match-end 2) (string-to-number (match-string 2 hms)) 0)
	       (string-to-number (match-string 3 hms)))
       t t hms)
    (error "Cannot parse HMS string \"%s\"" hms)))