From 0bbaf4b62bc5a6e6c813d9ebded1b9f35481f4f9 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 13 Jan 2018 18:29:37 +0100 Subject: [PATCH] =?UTF-8?q?[Org]=20Change=20time=20representation=20for=20?= =?UTF-8?q?=E2=80=98db/org-add-clock-line-to-file=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site-lisp/db-org.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index e198bfe..0cd49d3 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -1106,13 +1106,15 @@ ending at 23:61. When not given, FILES defaults to (defun db/org-add-clock-line-to-file (id start end) "Add clock line with START and END time to task identified by ID. -START and END must be given as org-mode timestamp strings." +START and END must be given as time objects as returned by +`encode-time’, or as an integer or float denoting seconds since +1970-01-01." (let ((location (org-id-find id t))) (when (null location) (user-error "ID %s cannot be found" id)) ;; Update existing clock lines - (let ((new-start (org-time-string-to-seconds start)) - (new-end (org-time-string-to-seconds end))) + (let ((new-start (float-time start)) + (new-end (float-time end))) (with-current-buffer (marker-buffer location) (db/org-map-clock-lines-and-entries (lambda (timestamp-1 timestamp-2)