Compare commits

..

No commits in common. "4e5cad284294ef102e90a8d14f22e855345301eb" and "f3354790c28b159404970d2edb8a077a708d9ac8" have entirely different histories.

2 changed files with 11 additions and 14 deletions

View File

@ -1274,7 +1274,7 @@ respectively."
(tags "REFILE" (tags "REFILE"
((org-agenda-files (list db/org-default-refile-file)) ((org-agenda-files (list db/org-default-refile-file))
(org-agenda-overriding-header "Things to refile (make it empty!)"))) (org-agenda-overriding-header "Things to refile (make it empty!)")))
(tags "HOLD-TODO=\"DONE\"-TODO=\"CANC\"-TODO=\"MRGD\"" (tags "HOLD"
((org-agenda-overriding-header "Tasks on Hold"))))) ((org-agenda-overriding-header "Tasks on Hold")))))

View File

@ -541,9 +541,6 @@ understood by `org-read-date'."
(defun org-dblock-write:db/org-workload-overview-report (params) (defun org-dblock-write:db/org-workload-overview-report (params)
"Write an overview workload report based on tasks in `org-agenda-files'. "Write an overview workload report based on tasks in `org-agenda-files'.
FIXME: this function is buggy, it is not treating the time-parts
correctly. Use with care!
This overview report will list the amount of work planned for This overview report will list the amount of work planned for
increasing intervals of time until a given end date is reached. increasing intervals of time until a given end date is reached.
For example, if the amount to increase the intervals is two For example, if the amount to increase the intervals is two
@ -577,7 +574,7 @@ PARAMS is a property list of the following parameters:
tasks to consider. Defaults to (todo)." tasks to consider. Defaults to (todo)."
(let* ((start-date (or (--if-let (plist-get params :start-date) (let* ((start-date (or (--if-let (plist-get params :start-date)
(org-read-date nil nil it)) (org-read-date nil nil it))
(org-read-date t nil ". 00:00"))) nil))
(end-date (or (--if-let (plist-get params :end-date) (end-date (or (--if-let (plist-get params :end-date)
(org-read-date nil nil it)) (org-read-date nil nil it))
(user-error "No valid end-date provided"))) (user-error "No valid end-date provided")))
@ -585,7 +582,8 @@ PARAMS is a property list of the following parameters:
"+1d")) "+1d"))
(org-ql-match (or (plist-get params :org-ql-match) (org-ql-match (or (plist-get params :org-ql-match)
'(todo))) '(todo)))
(current start-date) (current (or start-date
(org-read-date nil nil ". 00:00")))
(date-range nil)) (date-range nil))
;; Check input ;; Check input
@ -607,25 +605,24 @@ PARAMS is a property list of the following parameters:
;; maybe consider `org-read-date-get-relative' as well? ;; maybe consider `org-read-date-get-relative' as well?
(while (or (string< current end-date) (while (or (string< current end-date)
(string= current end-date)) (string= current end-date))
(push current date-range)
(setq current (org-read-date nil (setq current (org-read-date nil
nil nil
;; Add an extra + to ensure we increase the ;; Add an extra + to ensure we increase the
;; amount of time relative to the given
;; default time string. ;; default time string.
;; amount of time relative to the given
(format "+%s" increment) (format "+%s" increment)
nil nil
(org-time-string-to-time current))) (org-time-string-to-time current))))
(push current date-range))
(setq date-range (nreverse date-range)) (setq date-range (nreverse date-range))
(insert (format "#+CAPTION: Workload Overview Report at %s with start date [%s]\n" (insert (format "#+CAPTION: Workload Overview Report at %s.\n"
(with-temp-buffer (with-temp-buffer
;; Is there an easier way to get the current time as an ;; Is there an easier way to get the current time as an
;; inactive timestamp? ;; inactive timestamp?
(org-insert-time-stamp (current-time) t t) (org-insert-time-stamp (current-time) t t)
(buffer-string)) (buffer-string))))
start-date)) (insert "| Until | Planned Total |\n| <r> | <r> |\n|---|\n")
(insert "| End Time | Planned Total |\n| <r> | <r> |\n|---|\n")
;; Compute workload report for each date and record the total time; XXX: ;; Compute workload report for each date and record the total time; XXX:
;; this might be slow, try to reduce the calls to ;; this might be slow, try to reduce the calls to
;; `db/org-planned-tasks-in-range'. ;; `db/org-planned-tasks-in-range'.
@ -634,7 +631,7 @@ PARAMS is a property list of the following parameters:
interval-end-date interval-end-date
org-ql-match)))) org-ql-match))))
(insert "| ") (insert "| ")
(org-insert-time-stamp (org-time-string-to-time interval-end-date) t 'inactive) (org-insert-time-stamp (org-time-string-to-time interval-end-date) nil 'inactive)
(insert (format " | %s |\n" total-time)))) (insert (format " | %s |\n" total-time))))
(insert "|--|") (insert "|--|")
(org-table-align))) (org-table-align)))