Hi!

> I'm trying to use org-habit to track my habits and sometimes I don't
> get around to mark stuff as done on the day I do them. I've found two
> different functions for marking stuff as done in the past, but I can't
> get either of them to work.
> [...]

I did not check why the other functions fail.

What about the following function?  I'm on Org 9.

#v+
(defun mw-org-todo-with-other-date (date &optional arg)
  "Like `org-todo' but ask for a specific DATE.
Optional argument ARG prefix arg."
  (interactive (list (org-read-date) current-prefix-arg))
  (let* ((org-use-effective-time t)
         (hour
          (truncate
           (- (/ (org-time-stamp-to-now date t)
                 60 60))))
          (org-extend-today-until (1+ hour)))
    (org-todo arg)))
#v-

This function has been inspired by Org's `org-todo-yesterday'.  The
latter even does its job when triggered from the agenda.


HTH
                       Marco


Reply via email to