FIX clock thingy

This commit is contained in:
Nathan Dwarshuis 2024-11-21 09:13:50 -05:00
parent 14d4c2d696
commit ae8041b7ff
1 changed files with 6 additions and 5 deletions

View File

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