I write my weekly report on Wednesdays. As such I need to see what I've done starting last Wednesday until now. (usually a Wednesday).
I would like to create an Agenda view for this, so I can quickly flick between the weeks, but I cannot find a way of specifying '-7' days.
I tried customizing org-agenad-custom-commands
and setting the days to '-7' but that only shows the current day.
At present I generate a report for this:
#+BEGIN: clocktable :tstart "<-6d>" :tend "<now>" :scope agenda-with-archives :narrow 70 :formatter my-org-clocktable-notodo :maxlevel 3 :fileskip0
But I can't find a way to transpose this to an Agenda custom view. Is this possible?
[Edit solution]
As per lawlist's advise in the comment I got it to work.
1) I customized org-agenad-custom-commands
, added an agenda view that shows "Number of days in agenda" = 8. I assigned "W" to this agenda view.
'(org-agenda-custom-commands
....
("W" "Last 8 days." agenda ""
((org-agenda-span 8)
...
2) I then defined a function that temporarily defines the variable:
(defun my/agenda-last-week ()
(interactive)
(let ((org-agenda-start-day "-7d"))
(org-agenda nil "W"))
)
I then assign a hotkey to that function.
Now I can view my last week Wednesday to Wednesday, (inc time-report). I am happy.
org-agenda-list
isstart-day
, and the third argument isspan
.M-x describe-function RET org-agenda-list RET
. See: gnu.org/software/emacs/manual/html_node/org/… E.g., You can also set the start date using a date shift:(setq org-agenda-start-day "+10d")
will start the agenda ten days from today in the future. Presumably you can go the opposite direction with a negative argument. In a custom command situation, thesetq
is omitted because it takes on a let-bound value. – lawlist Jun 10 '15 at 16:11M-x describe-variable RET org-agenda-start-day RET
Here is a link to a thread that deals with what appears to be the same issue, entitled A weekly review in org-mode: stackoverflow.com/questions/17422781/… – lawlist Jun 10 '15 at 16:13org-agenda-start-day
do work exactly the way you suspect. I think your comment is really an answer. – erikstokes Jun 11 '15 at 0:09