Marcin Borkowski <mb...@mbork.pl> writes: >> Assume it's Sunday. I create a clock table with :wstart 0 and >> thisweek - and apparently my clock table starts 7 days ago. >> >> Now it's Monday. I create a clock table with :wstart 1 and thisweek - >> and my clock table starts today. >> >> What is the logic behind it? > > To clarify: I understand that the reason is the `if' from this line from > `org-clock.el': > > (setq diff (+ (* -7 shift) (if (= dow 0) (- 7 ws) (- dow ws))) > > (introduced ~10 years ago!). But why is it coded this way?
The commit goes like 0bca49801eac749b6adf39b176b9455566faac85 Author: Bastien Guerry <b...@altern.org> org-clock.el: Implement a new parameter :wstart to define the week start day - (setq diff (+ (* -7 shift) (if (= dow 0) 6 (1- dow))) + (setq diff (+ (* -7 shift) (if (= dow 0) (- 7 ws) (- dow ws))) I am not sure if there is any particular reason. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>