Function: org-habit-duration-to-days

org-habit-duration-to-days is a byte-compiled function defined in org-habit.el.gz.

Signature

(org-habit-duration-to-days TS)

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-habit.el.gz
(defun org-habit-duration-to-days (ts)
  (if (string-match "\\([0-9]+\\)\\([dwmy]\\)" ts)
      ;; lead time is specified.
      (floor (* (string-to-number (match-string 1 ts))
		(cdr (assoc (match-string 2 ts)
			    '(("d" . 1)    ("w" . 7)
			      ("m" . 30.4) ("y" . 365.25))))))
    (error "Invalid duration string: %s" ts)))