Fix: (org-ql-views) Beginning/end-of-week timestamp times

This commit is contained in:
Adam Porter 2019-10-19 01:07:15 -05:00
parent f2910261e2
commit 43b94dd4a8
2 changed files with 14 additions and 4 deletions

View file

@ -367,6 +367,7 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience
*Fixed* *Fixed*
+ In =org-ql-search=, accept symbol as ~:super-groups~ argument. + In =org-ql-search=, accept symbol as ~:super-groups~ argument.
+ In the =This week= and =Next week= default =org-ql-views= views, set timestamps for beginning-of-week to 00:00:00 and end-of-week to 23:59:59.
** 0.3.1 ** 0.3.1

View file

@ -147,8 +147,13 @@ See info node `(elisp)Cyclic Window Ordering'."
(cons "This week" (lambda () (cons "This week" (lambda ()
"Show items with an active timestamp during this calendar week." "Show items with an active timestamp during this calendar week."
(interactive) (interactive)
(let* ((beg-of-week (ts-adjust 'day (- (ts-dow (ts-now))) (ts-now))) (let* ((ts (ts-now))
(end-of-week (ts-adjust 'day (- 6 (ts-dow (ts-now))) (ts-now)))) (beg-of-week (->> ts
(ts-adjust 'day (- (ts-dow (ts-now))))
(ts-apply :hour 0 :minute 0 :second 0)))
(end-of-week (->> ts
(ts-adjust 'day (- 6 (ts-dow (ts-now))))
(ts-apply :hour 23 :minute 59 :second 59))))
(org-ql-search (org-agenda-files) (org-ql-search (org-agenda-files)
`(ts-active :from ,beg-of-week `(ts-active :from ,beg-of-week
:to ,end-of-week) :to ,end-of-week)
@ -159,8 +164,12 @@ See info node `(elisp)Cyclic Window Ordering'."
"Show items with an active timestamp during the next calendar week." "Show items with an active timestamp during the next calendar week."
(interactive) (interactive)
(let* ((ts (ts-adjust 'day 7 (ts-now))) (let* ((ts (ts-adjust 'day 7 (ts-now)))
(beg-of-week (ts-adjust 'day (- (ts-dow (ts-now))) ts)) (beg-of-week (->> ts
(end-of-week (ts-adjust 'day (- 6 (ts-dow (ts-now))) ts))) (ts-adjust 'day (- (ts-dow (ts-now))))
(ts-apply :hour 0 :minute 0 :second 0)))
(end-of-week (->> ts
(ts-adjust 'day (- 6 (ts-dow (ts-now))))
(ts-apply :hour 23 :minute 59 :second 59))))
(org-ql-search (org-agenda-files) (org-ql-search (org-agenda-files)
`(ts-active :from ,beg-of-week `(ts-active :from ,beg-of-week
:to ,end-of-week) :to ,end-of-week)