branch: externals/org commit 3f3ff643d2e2f0e65a7fd4ff0163944e1c62ae03 Author: Joost Helberg <jo...@cistus.nl> Commit: Ihor Radchenko <yanta...@gmail.com>
org-clock: Make quarter work as parameter for :step in clocktable Hi, many years ago a colleague and myself wrote a patch for quarters into org-mode/clocktable for blocks, today I noticed that :step should allow 'quarter' as an argument too. Here's the tiny patch to allow that. * doc/org-manual.org (The clock table): Document the new clocktable option. * lisp/org-clock.el: (org-clocktable-steps): Add new 'quarter allowed value. TINYCHANGE --- doc/org-manual.org | 2 +- lisp/org-clock.el | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index 794682b491..a37b8390cf 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -6754,7 +6754,7 @@ be selected: - =:step= :: - Set to =day=, =week=, =semimonth=, =month=, or =year= to split the + Set to =day=, =week=, =semimonth=, =month=, =quarter=, or =year= to split the table into chunks. To use this, either =:block=, or =:tstart= and =:tend= are required. diff --git a/lisp/org-clock.el b/lisp/org-clock.el index b432c7df76..360d532420 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -2846,6 +2846,7 @@ a number of clock tables." (`semimonth "Semimonthly report starting on: ") (`month "Monthly report starting on: ") (`year "Annual report starting on: ") + (`quarter "Quarterly report starting on: ") (_ (user-error "Unknown `:step' specification: %S" step)))) (week-start (or (plist-get params :wstart) 1)) (month-start (or (plist-get params :mstart) 1)) @@ -2898,6 +2899,7 @@ a number of clock tables." (if (< d 16) 16 1) (if (< d 16) m (1+ m)) y)) (`month (org-encode-time 0 0 0 month-start (1+ m) y)) + (`quarter (org-encode-time 0 0 0 month-start (+ 3 m) y)) (`year (org-encode-time 0 0 org-extend-today-until 1 1 (1+ y)))))) (table-begin (line-beginning-position 0)) (step-time