Skip to content

Commit

Permalink
Reduce n-days-view by 1 when setting org-timeblock-daterange
Browse files Browse the repository at this point in the history
  • Loading branch information
ichernyshovvv committed Nov 11, 2023
1 parent 7ac198c commit f840da6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions org-timeblock.el
Original file line number Diff line number Diff line change
Expand Up @@ -1406,15 +1406,19 @@ When BACKWARD is non-nil, move backward."
"Enter `org-timeblock-list-mode'."
(interactive)
(switch-to-buffer org-timeblock-list-buffer)
(setq org-timeblock-daterange (cons (ts-now) (ts-inc 'day org-timeblock-n-days-view (ts-now))))
(setq org-timeblock-daterange
(cons (ts-now)
(ts-inc 'day (1- org-timeblock-n-days-view) (ts-now))))
(org-timeblock-redraw-buffers))

;;;###autoload
(defun org-timeblock ()
"Enter `org-timeblock-mode'."
(interactive)
(switch-to-buffer org-timeblock-buffer)
(setq org-timeblock-daterange (cons (ts-now) (ts-inc 'day org-timeblock-n-days-view (ts-now))))
(setq org-timeblock-daterange
(cons (ts-now)
(ts-inc 'day (1- org-timeblock-n-days-view) (ts-now))))
(org-timeblock-redraw-buffers))

;;;; Planning commands
Expand Down Expand Up @@ -1843,7 +1847,9 @@ When called from Lisp, DATE should be a date as returned by
(interactive (list (ts-parse (org-read-date nil nil nil nil
(ts-internal (nth (1- org-timeblock-current-column) (org-timeblock-get-dates)))))))
(when date
(setq org-timeblock-daterange (cons date (ts-inc 'day org-timeblock-n-days-view date)))
(setq org-timeblock-daterange
(cons date
(ts-inc 'day (1- org-timeblock-n-days-view) date)))
(org-timeblock-redraw-buffers)))

(defun org-timeblock-day-earlier ()
Expand Down

0 comments on commit f840da6

Please sign in to comment.