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
This commit is contained in:
Joost Helberg 2021-10-05 09:26:39 +02:00 committed by Ihor Radchenko
parent 7c20552ed6
commit 3f3ff643d2
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
2 changed files with 3 additions and 1 deletions

View File

@ -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.

View File

@ -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