Hello. I noticed the following behavior and wondered if it was correct or 
unintentional.

Assume it is 21:53 right now. Then executing org-shiftright on the following 
headlines gives the following results (ignoring properties, state tracking, 
etc.).

[[BEFORE]]

* TODO foo
  SCHEDULED: <2025-11-14 Fri 10:00-11:00 .+1h>

* TODO bar
  SCHEDULED: <2025-11-14 Fri 20:00-21:00 .+1h>

[[AFTER]]

* TODO foo
  SCHEDULED: <2025-11-14 Fri 22:53 .+1h>

* TODO bar
  SCHEDULED: <2025-11-14 Fri 22:53-23:53 .+1h>

Note that the end time of foo has been discarded. I tried following the logic 
of org-auto-repeat-maybe, org-timestamp-change, etc., but couldn’t quite 
understand if this was intended.

Breaking on org-timestamp-change and then doing org-shiftright on foo shows 
that a first pass is done to change it to something like <2025-11-14 Fri 
21:59-23:89 .+1h>. Note the invalid end time (23:89). Then in a second pass, 
the invalid time is discarded. Indeed, you can induce an invalid time by 
manually placing the point at the start of a timestamp and executing 
(org-timestamp-change n ‘minute) with sufficiently large n. A key part of the 
invalid minutes value is in org-modify-ts-extra at the line

        (when (> minute 59) (setq minute (- minute 60) hour (1+ hour)))

which doesn’t seem to handle the case where the minutes is too large by more 
than 60 minutes.

Is this intentional?

Thanks,
Aaron


Reply via email to