Skip to content

Commit

Permalink
org-clock: Make quarter work as parameter for :step in clocktable
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Joost Helberg authored and yantar92 committed Sep 9, 2022
1 parent 7c20552 commit 3f3ff64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doc/org-manual.org
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 2 additions & 0 deletions lisp/org-clock.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3f3ff64

Please sign in to comment.