Sometimes I fall behind in my org-agenda maintenance and have to go back a few days to mark completed tasks. In 90% of cases, I want to mark the task as completed on the day it was due, but
org-agenda-todo always uses the current day and time.
What is the easiest way to mark agenda items as completed on the day currently being viewed in the agenda window?
Update: I attempted to adapt the answer to the linked question; ignoring the ugliness of my code, the date seems to be obtained, but
(defun org-agenda-todo-view-date (&optional arg) (interactive "P") (cl-letf* ((org-read-date-prefer-future nil) (my-current-time (org-read-date nil t (mapconcat 'number-to-string (append (last (calendar-gregorian-from-absolute org-starting-day)) (butlast (calendar-gregorian-from-absolute org-starting-day))) "-"))) ((symbol-function #'org-current-effective-time) #'(lambda () my-current-time))) (org-agenda-todo arg)))