From f57834ffbb6345a0d8f7113e4866c693280c625f Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Mon, 24 Apr 2023 15:27:23 +0100 Subject: Add custom export to ics --- ymh-emacs/ymh-diary.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ymh-emacs/ymh-diary.el b/ymh-emacs/ymh-diary.el index 343d331..4bbef62 100644 --- a/ymh-emacs/ymh-diary.el +++ b/ymh-emacs/ymh-diary.el @@ -35,6 +35,20 @@ (calendar-last-day-of-month month year))) (= day last-day-of-month))) +(defun ymh-diary-export-to-ics () + "Export diary file to ICal format." + (with-temp-buffer + (insert-file-contents diary-file) + (setq ics-file-body (org-diary-to-ical-string (current-buffer)))) + (with-temp-file "~/Downloads/emacs.ics" + (insert "BEGIN:VCALENDAR +PRODID:-//E-DIARY//E-DIARY 1.0//EN +VERSION:2.0 +METHOD:PUBLISH +X-WR-CALNAME:Emacs +X-Built-On-Cache-Miss:true +" ics-file-body "END:VCALENDAR"))) + (provide 'ymh-diary) ;;; ymh-diary.el ends here -- cgit