"Valentin G. J. Herrmann" via "General discussions about Org-mode." <emacs-orgmode@gnu.org> writes:
> In the attachments is a better version with tests that also addresses > your latest critique. Thanks! > + (setq time > + (save-match-data > + (org-time-string-to-time ts))) > + (unless (equal what "h") > + (setq time > + (time-add time > + (seconds-to-time (* 3600 > org-extend-today-until))))))) Another corner case: (setq org-extend-today-until 4) * TODO Heading <2023-08-12 Sat 17:00 ++1d> Timestamp a bit (< 4 hours) earlier than current wall time C-c C-t d * TODO Heading <2023-08-13 Sun 17:00 ++1d> Expected: * TODO Heading <2023-08-14 Mon 17:00 ++1d> I generally feel that the approach with `time-add' will have a number of weird corner cases. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>