Rudolf Adamkovič Personal site


Exercise anniversary

… is derived from the earliest exercise day

\[\begin{equation*}
  \min D \approx 19386.958333333332
  = \underbrace{\> \text{2023-01-30} \>}
  _{\substack{\text{ISO 8601} \\ \text{date}}}
\end{equation*}
\]

computed by

(defun my-exercise-anniversary-date ()
  (format-time-string "%Y-%m-%d"
                      (* (my-exercise-anniversary)
                         24 60 60)))
(defun my-exercise-anniversary ()
  (let ((anniversary nil))
    (maphash (lambda (day _)
               (when (or (not anniversary)
                         (< day anniversary))
                 (setq anniversary day)))
             (my-exercise-log))
    anniversary))

The Org Agenda anniversary is computed by

(defun my-exercise-org-anniversary ()
  (interactive)
  (format (concat "%%%%(org-anniversary %s)"
                  " /me starts exercising, %%d year(s) ago")
          (format-time-string "%Y %m %d"
                              (* (my-exercise-anniversary)
                                 24 60 60))))
(my-exercise-org-anniversary)

“%%(org-anniversary 2023 01 30) /me starts exercising, %d year(s) ago”


© 2024 Rudolf Adamkovič under GNU General Public License version 3.
Made with Emacs and the secret alien technologies of yesteryear.