summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2023-04-24 15:27:23 +0100
committerYann Herklotz <git@yannherklotz.com>2023-04-24 15:27:23 +0100
commitf57834ffbb6345a0d8f7113e4866c693280c625f (patch)
treeca8c64e9402082a32478a705469104ebd94cdf8c
parent30364233180cc649fcf5e138518050928a69882c (diff)
downloadymh-emacs-f57834ffbb6345a0d8f7113e4866c693280c625f.tar.gz
ymh-emacs-f57834ffbb6345a0d8f7113e4866c693280c625f.zip
Add custom export to ics
-rw-r--r--ymh-emacs/ymh-diary.el14
1 files changed, 14 insertions, 0 deletions
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