.emacs.d/site-lisp
Daniel Borchmann a67e64a906
Include computation of already spent work time in overview report
This change is an experimental, as quite a bit of code had to be
touched.  Further testing and bug hunting will be necessary.

Workload overview reports now only allow increments of one day
(`+1d`), since the current implementation cannot accomodate for arbitray
time ranges anymore (my fault, sorry).  Also, the default start time for
workload overview reports has been changed to 23:59 on the previous
day (`"-1d 23:59"`) to include the current day in the report.  The
rational behind this is that since the remaining work hours of today are
now included in the computation for the report, showing the entry for
today will show an accurate estimation of the remaining work time in
contrast to a constant value.

There are now additional parameters named `:work-hours` and
`:work-items-match` that specify how much work time is available on a
day and which Org items are considered work, respectively.
`:work-hours` can also take a function to compute for a given date how
much time can be spent on work.  An example could be something like
this:

```emacs-lisp
(defun db/get-worktime-for-date (date)
  "Return planned working time for DATE."
  ;; This is a simplification, as `date' might be the start of the day or the end.
  (cond
   ((string-match-p "Sa" date) "6:00")
   ((string-match-p "So\\|Sun" date) "4:00")
   ((string-match-p "Wed\\|Mi" date) "3:00")
   (t "2:00")))
```

An example report is then the following:

```
|               End Time | Planned Work | Work Hours | Utilization |
|                    <r> |          <r> |        <r> |         <r> |
|------------------------+--------------+------------+-------------|
| [2024-10-06 Sun 23:59] |         1:00 |       1:00 |   *100.00%* |
| [2024-10-07 Mon 23:59] |         4:15 |       3:00 |   *141.67%* |
| [2024-10-08 Tue 23:59] |         7:00 |       5:00 |   *140.00%* |
| [2024-10-09 Wed 23:59] |         9:15 |       8:00 |   *115.62%* |
| [2024-10-10 Thu 23:59] |        12:30 |      10:00 |   *125.00%* |
| [2024-10-11 Fri 23:59] |        13:15 |      12:00 |   *110.42%* |
| [2024-10-12 Sat 23:59] |        19:30 |      18:00 |   *108.33%* |
| [2024-10-13 Sun 23:59] |      1d 1:30 |      22:00 |   *115.91%* |
| [2024-10-14 Mon 23:59] |      1d 1:45 |    1d 0:00 |   *107.29%* |
| [2024-10-15 Tue 23:59] |      1d 2:30 |    1d 2:00 |   *101.92%* |
|------------------------+--------------+------------+-------------|
```
2024-10-06 15:31:04 +02:00
..
term Initial commit 2017-07-16 18:07:00 +02:00
db-customize.el Fix wrong defaults for frequently used shortcuts 2024-07-08 13:59:22 +02:00
db-emms.el Rename main music hydra and move it to `db-music' 2020-06-27 10:16:53 +02:00
db-eshell.el Also change to default-directory when not in eshell already 2023-10-12 16:39:29 +02:00
db-hydras.el Allow to reset current text scaling directly 2024-01-04 08:28:14 +01:00
db-latex.el Separate TeX configuration into separate package 2023-10-28 12:06:27 +02:00
db-mail.el Remove calls to some obsolete CL functions 2021-01-16 14:34:48 +01:00
db-music.el Minor reformatting in music-control hydra 2024-03-24 16:55:19 +01:00
db-org.el Include computation of already spent work time in overview report 2024-10-06 15:31:04 +02:00
db-projects.el Match namespace prefix for project utilities with package name 2022-10-16 21:10:45 +02:00
db-utils-test.el Fix precision error in `db/ntp-to-time' 2020-06-27 09:35:31 +02:00
db-utils.el Save bookmarks added with custom handlers 2024-07-06 09:18:31 +02:00
org-password-manager.el Ensure org-password-manager only checks for properties when in Org 2024-06-19 16:45:01 +02:00
plantuml-mode.el Add missing type and group declaration in plantuml-mode 2023-10-27 17:06:01 +02:00
timeline-tools-test.el Trying to make test for `timeline-tools' independent of locale 2020-01-05 14:32:35 +01:00
timeline-tools.el Fix some warnings in timeline-tools 2024-06-11 18:19:37 +02:00