I'm trying to set org-duration-units
that's used by org-mode
effort estimates for formatting times in 8 hour days instead of 24 hours days.
I'm in no way an emacs and lisp expert, currently learning as I go along. I tried this in my ~/.emacs
file:
(use-package org
:mode (("\\.org$" . org-mode))
:ensure org-plus-contrib
:custom
(org-duration-units `(("min" . 1)
("h" . 60)
("d" . ,(* 60 8))
("w" . ,(* 60 8 5))
("m" . ,(* 60 8 5 4))
("y" . ,(* 60 8 5 4 11)))
)
:config
(setq org-clock-persist 'history)
(org-clock-persistence-insinuate)
(setq org-clock-idle-time 15)
(setq org-duration-format 'h:mm)
;; also tried to set it in the config block instead to be executed after load
;; (setq org-duration-units `(("min" . 1)
;; ("h" . 60)
;; ("d" . ,(* 60 8))
;; ("w" . ,(* 60 8 5))
;; ("m" . ,(* 60 8 5 4))
;; ("y" . ,(* 60 8 5 4 11))))
;; (org-duration-set-regexps)
)
I then try to use org-duration-from-minutes
in some code displaying a table to convert a duration to some nicely formatted times with 8 hour days. Here is a minimum org-mode example:
#+BEGIN_SRC emacs-lisp
;; six month of 4 weeks of 5 days of 8 hours per day (120 days of 8 hours)
;; expecting 6m 00:00
;; or 40 days of 24 hours
(print (org-duration-from-minutes 57600 ))
#+END_SRC
#+RESULTS:
: 40d 0:00
It shows it in 24h days format. When I run
(setq org-duration-units `(("min" . 1) ("h" . 60) ("d" . ,(* 60 8)) ("w" . ,(* 60 8 5)) ("m" . ,(* 60 8 5 4)) ("y" . ,(* 60 8 5 4 10))) )
Then it shows it as 120d 0:00
How do I get emacs to set org-duration-units
at startup ? It looks like it's either not set or overridden in the way I do it.