I’ve been trying to fix this on my own for basically the whole day now, unfortunately I couldn’t. So I hope anyone can help me here — I am right in thinking that setting the sync for the timestamps should be able both ways as well, right? So whenever I change the timestamp in org-mode, it should appear in my (Nextcloud) calendar and whenever I change it in Nextcloud, it should appear in org-mode? If that’s true, it doesn’t work for me, unfortunately.
The title does change, but the timestamp doesn’t when changing it in my calendar. I have set the debug level to 2 and here’s the org-caldav-debug buffer when adding an event for that particular event:
=== Updating events in calendar
Event UID 141701ec-3ddb-460c-8230-884641846d71: Org --> Cal
Putting event UID 141701ec-3ddb-460c-8230-884641846d71.
Content of event UID 141701ec-3ddb-460c-8230-884641846d71:
BEGIN:VCALENDAR
PRODID:
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20201028T181852Z
UID:141701ec-3ddb-460c-8230-884641846d71
DTSTART;TZID=Europe/Berlin:20201029T090000
DTEND;TZID=Europe/Berlin:20201029T110000
SUMMARY:S: Test
CATEGORIES:termine
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:S: Test
TRIGGER:-P0DT0H15M0S
END:VALARM
END:VEVENT
END:VCALENDAR
It then appears as it should in my calendar. Now if I change the title and the timestamp, this appears in my log:
Now it seems to me that the correct timestamps are detected (DTSTART and DTEND), however in my org buffer only the title gets updated.
By the way, this is my config, I have to admit I got most of it from Reddit, maybe there’s something wrong in there somwhere, although I think I understand what it does:
(use-package! org-caldav
:init
;; This is the sync on close function; it also prompts for save after syncing so
;; no late changes get lost
(defun org-caldav-sync-at-close ()
(org-caldav-sync)
(save-some-buffers)
)
;; This is the delayed sync function; it waits until emacs has been idle for
;; "secs" seconds before syncing. The delay is important because the caldav-sync
;; can take five or ten seconds, which would be painful if it did that right at save.
;; This way it just waits until you've been idle for a while to avoid disturbing
;; the user.
(defvar org-caldav-sync-timer nil
"Timer that `org-caldav-push-timer' used to reschedule itself, or nil.")
(defun org-caldav-sync-with-delay (secs)
(when org-caldav-sync-timer
(cancel-timer org-caldav-sync-timer))
(setq org-caldav-sync-timer
(run-with-idle-timer
(* 1 secs) nil 'org-caldav-sync)))
;; actual config
(setq org-caldav-inbox (concat org-directory "/inbox.org")
org-caldav-save-directory org-directory)
(setq org-icalendar-timezone "Europe/Berlin")
(setq org-caldav-url "https://cloud.jotunn.de/remote.php/dav/calendars/loki")
;; for some reason, timestamps do NOT get synced with title-and-timestamp. so i have to use all.
(setq org-caldav-sync-changes-to-org 'title-and-timestamp)
(setq org-caldav-calendars
`((:calendar-id "moledur"
:inbox "~/Nextcloud/org-Notes/moledur.org")
(:calendar-id "tasks"
:inbox "~/Nextcloud/org-Notes/tasks.org")
(:calendar-id "ziele"
:inbox "~/Nextcloud/org-Notes/ziele.org")
(:calendar-id "shopping"
:inbox "~/Nextcloud/org-Notes/shopping.org")
;; (:calendar-id "test"
(:calendar-id "termine"
:inbox "~/Nextcloud/org-Notes/termine.org")))
(setq org-caldav-backup-file "~/Nextcloud/org-Notes/backup/agenda.org")
:config
(setq org-icalendar-alarm-time 15)
;; This makes sure to-do items as a category can show up on the calendar
(setq org-icalendar-include-todo t)
;; This ensures all org "deadlines" show up, and show up as due dates
(setq org-icalendar-use-deadline '(event-if-todo event-if-not-todo todo-due))
;; This ensures "scheduled" org items show up, and show up as start times
(setq org-icalendar-use-scheduled '(event-if-todo event-if-not-todo todo-start))
;; Add the delayed save hook with a five minute idle timer
(add-hook 'after-save-hook
(lambda ()
(when (eq major-mode 'org-mode)
(org-caldav-sync-with-delay 300))))
;; Add the close emacs hook
(add-hook 'kill-emacs-hook 'org-caldav-sync-at-close))
I did test this with events where i specify both the start and the end time, with different calendars, different CalDAV clients, different CalDAV servers but I really am at a point now where I can’t get any further. Does anyone have a hint for me? Thanks already. I’m really desperate, otherwise I wouldn’t be asking here, because usually I figure stuff out myself.
Hi!
I’ve been trying to fix this on my own for basically the whole day now, unfortunately I couldn’t. So I hope anyone can help me here — I am right in thinking that setting the sync for the timestamps should be able both ways as well, right? So whenever I change the timestamp in org-mode, it should appear in my (Nextcloud) calendar and whenever I change it in Nextcloud, it should appear in org-mode? If that’s true, it doesn’t work for me, unfortunately.
The title does change, but the timestamp doesn’t when changing it in my calendar. I have set the debug level to 2 and here’s the org-caldav-debug buffer when adding an event for that particular event:
It then appears as it should in my calendar. Now if I change the title and the timestamp, this appears in my log:
Now it seems to me that the correct timestamps are detected (DTSTART and DTEND), however in my org buffer only the title gets updated.
By the way, this is my config, I have to admit I got most of it from Reddit, maybe there’s something wrong in there somwhere, although I think I understand what it does:
I did test this with events where i specify both the start and the end time, with different calendars, different CalDAV clients, different CalDAV servers but I really am at a point now where I can’t get any further. Does anyone have a hint for me? Thanks already. I’m really desperate, otherwise I wouldn’t be asking here, because usually I figure stuff out myself.