Skip to content

Commit

Permalink
FIX: use format-time-string
Browse files Browse the repository at this point in the history
  • Loading branch information
guidoschmidt committed Apr 21, 2024
1 parent 26d43b2 commit 3230393
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions circadian.el
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,18 @@ set and and sort the final list by time."
(cl-first (cl-first next-entry))
(cl-second (cl-first next-entry)))))
(unless (equal (list theme) custom-enabled-themes)
(circadian-enable-theme theme))
(circadian-enable-theme theme)
(message (concat "[circadian.el] → Next run @ " (format-time-string "%H:%M" next-time)))
(run-at-time next-time nil #'circadian-activate-current))
next-time))


(defun circadian-activate-and-schedule ()
"Check which themes are overdue to be activated and load the last."
(interactive)
(cancel-function-timers #'circadian-activate-current)
(let* ((next-time (circadian-activate-current))
(time (decode-time (time-convert next-time 'list)))
(time-str (format "%02d:%02d:00" (nth 2 time) (nth 1 time))))
(message "[circadian.el] → Next run @ %02d:%02d:%02d"
(nth 2 time) (nth 1 time) (nth 0 time))
(run-at-time time-str nil #'circadian-activate-current)))
(let* ((next-time (circadian-activate-current)))
(run-at-time next-time nil #'circadian-activate-current)))

;; --- Sunset-sunrise
(defun circadian--frac-to-time (f)
Expand Down

0 comments on commit 3230393

Please sign in to comment.