diff --git a/local/lib/org-x/org-x.el b/local/lib/org-x/org-x.el index b4e49c2..f75d147 100644 --- a/local/lib/org-x/org-x.el +++ b/local/lib/org-x/org-x.el @@ -1883,13 +1883,14 @@ ARG, ask for a range in minutes in place of the second date." (let* ((t1 (read-date nil)) (t2 (if (equal arg '(4)) (read-duration t1) (read-date t1)))) (if (< t2 t1) (message "Second timestamp earlier than first!") - (let ((s (org-ml-unixtime-to-time-long t1)) - (e (org-ml-unixtime-to-time-long t2))) + (let ((s (org-ml-unixtime-to-timelist t t1)) + (e (org-ml-unixtime-to-timelist t t2))) (org-ml-update-this-headline* (org-ml-headline-map-logbook-clocks* (org-x-logbook-config) - (let ((new-clock (org-ml-build-clock! s :end e))) - (if (org-ml-clock-is-running (car it)) - `(,(car it) ,new-clock ,@(cdr it)) + (let ((new-clock (org-ml-build-clock! s :end e)) + (first-clock (car it))) + (if (and first-clock (org-ml-clock-is-running first-clock)) + `(,first-clock ,new-clock ,@(cdr it)) (cons new-clock it))) it)))))))