diff options
author | Thanos Apollo <[email protected]> | 2024-01-09 10:37:10 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-01-09 10:37:10 +0200 |
commit | bdf07ba3adf599ac5027fd741923de7dfc41c851 (patch) | |
tree | 08f3415eb845193ff387aa2687616bb14a3ea3ea /gnosis.el | |
parent | 83a1e5d9c4a8dfb7e13ef67df1cf1913de917e05 (diff) |
Add gnosis-past-or-present-p
Seperate the comparing of dates, emacsql is way too buggy for
comparing lists directly
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -710,6 +710,15 @@ if DUE is t, return only due notes" when (not (gnosis-suspended-p note)) collect note))) +(defun gnosis-past-or-present-p (date) + "Compare the input DATE with the current date. +Return t if DATE is today or in the past, nil if it's in the future. +DATE is a list of the form (year month day)." + (let* ((now (gnosis-algorithm-date)) + (time-now (encode-time 0 0 0 (nth 2 now) (nth 1 now) (nth 0 now))) + (time-date (encode-time 0 0 0 (nth 2 date) (nth 1 date) (nth 0 date)))) + (not (time-less-p time-now time-date)))) + (defun gnosis-due-tags () "Return a list of due note tags." (let ((due-notes (gnosis-review-get-due-notes))) |