<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-calendar-sync--date-to-time.el, branch load-graph-classify-start</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=load-graph-classify-start</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=load-graph-classify-start'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-05-03T12:53:51+00:00</updated>
<entry>
<title>test(calendar-sync): fix weekday-string lookup to match production</title>
<updated>2026-05-03T12:53:51+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-03T12:53:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=8ec668d6749b22f47a4c614d0965445dcfa86f50'/>
<id>urn:sha1:8ec668d6749b22f47a4c614d0965445dcfa86f50</id>
<content type='text'>
The boundary test for `calendar-sync--expand-weekly` with a 5-element UNTIL built its byday string from `'("SU" "MO" "TU" "WE" "TH" "FR" "SA")`, a 0-indexed Sunday-first array. The production code uses Monday=1, Sunday=7 throughout: `calendar-sync--date-weekday` returns it that way and `calendar-sync--weekday-to-number` expects it. When start-date landed on a Sunday (start-weekday=7), `(nth 7 array)` overran the 7-element list and returned nil. Then byday=(nil), and inside expand-weekly `(mod (- nil current-weekday) 7)` raised "wrong-type-argument number-or-marker-p nil".

The mismatch made the test fail every Saturday (when "tomorrow" is Sunday) and pass the other six days. The flake had been blamed on stale `.elc` in earlier triage, but `make clean &amp;&amp; make test` reproduced the failure on Saturdays.

I switched the lookup to `(nth (1- start-weekday) '("MO" "TU" "WE" "TH" "FR" "SA" "SU"))`, the same convention as every other weekday-mapping in the codebase. I verified across all 7 weekdays via a faked `current-time`: each produces exactly 1 occurrence as expected.

Production code is internally consistent. No production change needed.
</content>
</entry>
<entry>
<title>fix(calendar-sync): handle variable-length date lists in RRULE UNTIL</title>
<updated>2026-03-10T04:40:26+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-03-10T04:40:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=37a7bf1bf54512def40bee8405939d101a136f45'/>
<id>urn:sha1:37a7bf1bf54512def40bee8405939d101a136f45</id>
<content type='text'>
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.
</content>
</entry>
</feed>
