aboutsummaryrefslogtreecommitdiff
path: root/modules/calendar-sync.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-03-09 23:40:26 -0500
committerCraig Jennings <c@cjennings.net>2026-03-09 23:40:26 -0500
commit3966bb60fe8cd2498ae01406085e74b74e7e6bba (patch)
tree1e8db6f4fea708e4875ef6451f165676be359179 /modules/calendar-sync.el
parent9a0bb451712c1a1a0aa3cd7df106aa31ec641459 (diff)
downloaddotemacs-3966bb60fe8cd2498ae01406085e74b74e7e6bba.tar.gz
dotemacs-3966bb60fe8cd2498ae01406085e74b74e7e6bba.zip
fix(calendar-sync): handle variable-length date lists in RRULE UNTIL
date-to-time used (reverse date) which broke when RRULE UNTIL values were parsed as 5-element lists (year month day hour minute) from UTC timestamps. This caused recurring events with UTC UNTIL dates to expand to 0 occurrences, producing stale calendar entries.
Diffstat (limited to 'modules/calendar-sync.el')
-rw-r--r--modules/calendar-sync.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/calendar-sync.el b/modules/calendar-sync.el
index 106c87f7f..610281d26 100644
--- a/modules/calendar-sync.el
+++ b/modules/calendar-sync.el
@@ -894,9 +894,13 @@ Returns string like '<2025-11-16 Sun 14:00-15:00>' or '<2025-11-16 Sun>'."
;;; Helper Functions
(defun calendar-sync--date-to-time (date)
- "Convert DATE (year month day) to time value for comparison.
-DATE should be a list like (year month day)."
- (apply #'encode-time 0 0 0 (reverse date)))
+ "Convert DATE to time value for comparison.
+DATE should be a list starting with (year month day ...).
+Only the first three elements are used; extra elements (hour, minute) are ignored."
+ (let ((day (nth 2 date))
+ (month (nth 1 date))
+ (year (nth 0 date)))
+ (encode-time 0 0 0 day month year)))
(defun calendar-sync--before-date-p (date1 date2)
"Return t if DATE1 is before DATE2.