diff --git a/lisp/org-taskjuggler.el b/lisp/org-taskjuggler.el index d2e5c1f..8f9174e 100644 --- a/lisp/org-taskjuggler.el +++ b/lisp/org-taskjuggler.el @@ -615,17 +615,19 @@ is defined it will calculate a unique id for the resource using "Translate effort strings into a format acceptable to taskjuggler, i.e. REAL UNIT. If the effort string is something like 5:30 it will be assumed to be hours and will be translated into 5.5h. -Otherwise if it contains something like 3.0 it is assumed to be -days and will be translated into 3.0d. Other formats that -taskjuggler supports (like weeks, months and years) are currently -not supported." +TaskJuggler-compatible units are also supported for hours (h), +days (d), weeks (w), months (m) and years (y) and so effort can +be specified like 3h or 4.5d. Otherwise if it contains a bare +effort without a unit such as 3.0 it is assumed to be days and +will be translated into 3.0d." (cond ((null effort) effort) ((string-match "\\([0-9]+\\):\\([0-9]+\\)" effort) (let ((hours (string-to-number (match-string 1 effort))) (minutes (string-to-number (match-string 2 effort)))) - (format "%dh" (+ hours (/ minutes 60.0))))) - ((string-match "\\([0-9]+\\).\\([0-9]+\\)" effort) (concat effort "d")) + (format "%.1fh" (+ hours (/ minutes 60.0))))) + ((string-match "^\\([0-9]+\\)\\(\\.\\([0-9]+\\)\\)?\\([hdwmy]\\)$" effort) effort) + ((string-match "^\\([0-9]+\\)\\.\\([0-9]+\\)$" effort) (concat effort "d")) (t (error "Not a valid effort (%s)" effort)))) (defun org-taskjuggler-get-priority (priority)