unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#68653: Excorporate: generate better org timestamps
@ 2024-01-21 19:52 Benjamin Leis
  2024-02-15  3:38 ` Thomas Fitzsimmons
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Leis @ 2024-01-21 19:52 UTC (permalink / raw)
  To: 68653


[-- Attachment #1.1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #1.2: Type: text/html, Size: 26 bytes --]

[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 1322 bytes --]

diff --git a/excorporate-org.el b/excorporate-org.el
index 74dbe9d..56863c4 100644
--- a/excorporate-org.el
+++ b/excorporate-org.el
@@ -1,4 +1,4 @@
-;;; excorporate-org.el --- Exchange Org Mode view     -*- lexical-binding: t -*-
+xs;;; excorporate-org.el --- Exchange Org Mode view     -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
 
@@ -251,11 +251,12 @@ identifier."
 		      "TODO"
 		    "DONE")))
     (insert (format "** %s %s\n" keyword subject))
-    (org-schedule nil (format-time-string "<%Y-%m-%d %a %H:%M>"
-					  start-time))
-    (forward-line -1)
-    (end-of-line)
-    (insert  "--" (format-time-string "<%Y-%m-%d %a %H:%M>" end-time))
+    ;; If the meeting times are on the same day use a time period otherwise use a range of days
+    (if (= (time-to-day-in-year start-time) (time-to-day-in-year end-time))
+	(org-schedule nil (format "<%s-%s>" (format-time-string "%Y-%m-%d %a %H:%M" start-time)
+				  (format-time-string "%H:%M" end-time)))
+      (org-schedule nil (format "<%s>--<%s>" (format-time-string "%Y-%m-%d %a %H:%M" start-time)
+				(format-time-string "%Y-%m-%d %a %H:%M" end-time))))
     (forward-line)
     (org-set-property "Identifier" (format "%S" item-identifier))
     (org-insert-time-stamp (current-time) t t "+ Retrieved " "\n")))

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-19 14:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-21 19:52 bug#68653: Excorporate: generate better org timestamps Benjamin Leis
2024-02-15  3:38 ` Thomas Fitzsimmons
2024-02-19 11:25   ` Ihor Radchenko
2024-02-19 14:07     ` Thomas Fitzsimmons

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).