aboutsummaryrefslogtreecommitdiff
path: root/chime.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-02-17 00:11:52 -0600
committerCraig Jennings <c@cjennings.net>2026-02-17 00:11:52 -0600
commit30cf2bfe06d443da1ff41ab9bddc4bd6a431aa5f (patch)
tree85662cdabb06f70801ece0c7b2b77957c5131a8c /chime.el
parent4835fadabf243b33fb78557e45428055675e7300 (diff)
downloadchime-30cf2bfe06d443da1ff41ab9bddc4bd6a431aa5f.tar.gz
chime-30cf2bfe06d443da1ff41ab9bddc4bd6a431aa5f.zip
Fix time comparison bugs in chime--time= and chime--timestamp-within-interval-p
chime--time= was using %d:%H:%M (day-of-month only), causing false matches across different months/years. Now uses %Y-%m-%d %H:%M for full date comparison. chime--timestamp-within-interval-p now accepts numeric timestamps (integer/float) in addition to lists.
Diffstat (limited to 'chime.el')
-rw-r--r--chime.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/chime.el b/chime.el
index 08c9632..6e89aa9 100644
--- a/chime.el
+++ b/chime.el
@@ -606,7 +606,7 @@ for org-agenda-files to be populated)."
Comparison is performed by converted each element of LIST onto string
in order to ignore seconds."
(->> list
- (--map (format-time-string "%d:%H:%M" it))
+ (--map (format-time-string "%Y-%m-%d %H:%M" it))
(-uniq)
(length)
(= 1)))
@@ -623,8 +623,8 @@ Returns nil if TIMESTAMP or INTERVAL is invalid."
(and timestamp
interval
(numberp interval)
- ;; Validate timestamp is a proper time value (list of integers)
- (listp timestamp)
+ ;; Validate timestamp is a proper time value (accepts list, integer, or float)
+ (or (listp timestamp) (numberp timestamp))
(chime--time=
(time-add (current-time) (seconds-to-time (* 60 interval)))
timestamp)))