refactor!: do not include time zone in org iso8601

org mode timestamps do not support time zones, so returning the
machine's local time zone is misleading.

Also, org-format-time-string is an obsolete alias of format-time-string.

Ref: cc2490a706
This commit is contained in:
Dustin Farris
2025-02-17 11:33:57 -08:00
parent 2490afe110
commit bb08be4740
2 changed files with 4 additions and 4 deletions

View File

@ -367,12 +367,12 @@ If HASH is non-nil, use that as the file's hash without recalculating it."
(defun org-roam-db-get-scheduled-time ()
"Return the scheduled time at point in ISO8601 format."
(when-let ((time (org-get-scheduled-time (point))))
(org-format-time-string "%FT%T%z" time)))
(format-time-string "%FT%T" time)))
(defun org-roam-db-get-deadline-time ()
"Return the deadline time at point in ISO8601 format."
(when-let ((time (org-get-deadline-time (point))))
(org-format-time-string "%FT%T%z" time)))
(format-time-string "%FT%T" time)))
(defun org-roam-db-node-p ()
"Return t if headline at point is an Org-roam node, else return nil."

View File

@ -41,7 +41,7 @@
(it "should get scheduled time for current heading node"
(org-roam-id-open "a523c198-4cb4-44d2-909c-a0e3258089cd" nil)
(expect (org-roam-db-get-scheduled-time) :to-equal "2024-07-16T00:00:00+0000")))
(expect (org-roam-db-get-scheduled-time) :to-equal "2024-07-16T00:00:00")))
(describe "org-roam-db-get-deadline-time"
(before-all
@ -58,7 +58,7 @@
(it "should get deadline time for current heading node"
(org-roam-id-open "3ab84701-d1c1-463f-b5c6-715e6ff5a0bf" nil)
(expect (org-roam-db-get-deadline-time) :to-equal "2024-07-17T00:00:00+0000")))
(expect (org-roam-db-get-deadline-time) :to-equal "2024-07-17T00:00:00")))
(describe "org-roam-db--file-hash"
(it "computes the SHA1 of file"