org-clock.el: add semimonth step for clocktables

* lisp/org-clock.el (org-clocktable-steps): Add a semimonth step for
producing clock tables.

Originally proposed "bimonth" as name; however, bimonthly is
ambiguous, as it can mean 2 different things, semimonthly or every 2
months.

TINYCHANGE
This commit is contained in:
Christian Hopps 2020-03-20 06:58:29 -04:00 committed by Kyle Meyer
parent 7a78eb1be0
commit 8a99404c84
1 changed files with 4 additions and 0 deletions

View File

@ -2784,6 +2784,7 @@ a number of clock tables."
(pcase step
(`day "Daily report: ")
(`week "Weekly report starting on: ")
(`semimonth "Semimonthly report starting on: ")
(`month "Monthly report starting on: ")
(`year "Annual report starting on: ")
(_ (user-error "Unknown `:step' specification: %S" step))))
@ -2833,6 +2834,9 @@ a number of clock tables."
(let ((offset (if (= dow week-start) 7
(mod (- week-start dow) 7))))
(list 0 0 org-extend-today-until (+ d offset) m y)))
(`semimonth (list 0 0 0
(if (< d 16) 16 1)
(if (< d 16) m (1+ m)) y))
(`month (list 0 0 0 month-start (1+ m) y))
(`year (list 0 0 org-extend-today-until 1 1 (1+ y)))))))
(table-begin (line-beginning-position 0))