5

Using org mode agenda I've been able to customize a view to have all tasks no matter if finished or not this way:

 (setq org-agenda-custom-commands
      '(("w" "Whole Agenda no matter status"
         ((todo "TODO|IN-PROGRESS|DONE|CANCELLED"))) 
        ))

I need a step more: group by month showing a header, but I'm stuck. I don´t know how to group tasks by month in my custom view (preferably month of DONE date if exists, if not, then date of insertion).

something like this:

January
-------------
Project A:DONE task1  2019-01-01
Project A:CANCELLED task2  2019-01-02
Project B:DONE task3 2019-01-03
February
--------------
Project A:TODO task4 2019-02-01
Project B:TODO task5 2019-02-04

Thanks in advance

1 Answer 1

3
+50

Using org-super-agenda https://github.com/alphapapa/org-super-agenda
It groups agenda view lines in many possible ways.

When installed, a hook and interactive function (M-x eval-buffer in scratch, or saved in .emacs):

(add-hook 'org-agenda-mode-hook #'org-super-agenda-mode)

(defun my-monthly-agenda ()
  (interactive)
  (let ((org-agenda-custom-commands
         '(("w" "Whole Agenda no matter status"
            ((todo "TODO|IN-PROGRESS|DONE|CANCELLED")))))

        (org-super-agenda-groups
         '((:auto-map
            (lambda (item)
              (let ((ts (assoc "TIMESTAMP" (org-entry-properties))))
                (if ts
                    (let* ((date-parts (org-parse-time-string (cdr ts)))
                           (month (nth 4 date-parts)) (year (nth 5 date-parts)))
                      (format-time-string "%B %Y" (encode-time 1 1 1 1 month year)))
                  ;; else
                  "W/o timestamp")))))))
    (org-agenda nil "w")))

M-x my-monthly-agenda

Result:

Global list of TODO items of type: TODO|IN-PROGRESS|DONE|CANCELLED

 January 2019
  test:       TODO Prepare slides               :work:boss:notes::action:

 November 2006
  test:       TODO Write letter to Sam Fortune

 W/o timestamp
  test:       DONE Head A
  test:       TODO Prepare slides 2             :work:boss:notes::action:
3
  • but an issue arised. Order is not monthly order but alphabeticall, i mean, groups are W/o timestamp,, december 2006, January 2006,november 2006
    – Forge
    Jan 17, 2019 at 11:24
  • Looks like this not not fetch IN-PROGRESS if lines started with * IN-PROGRESS ...
    – alper
    Nov 4, 2022 at 11:53
  • This only shows W/o timestamp section
    – alper
    May 17, 2023 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.