90 |
|
|
91 |
;;; Code: |
;;; Code: |
92 |
|
|
93 |
(defconst icalendar-version 0.10 |
(defconst icalendar-version 0.11 |
94 |
"Version number of icalendar.el.") |
"Version number of icalendar.el.") |
95 |
|
|
96 |
;; ====================================================================== |
;; ====================================================================== |
415 |
"Return ISODURATIONSTRING in format like `decode-time'. |
"Return ISODURATIONSTRING in format like `decode-time'. |
416 |
Converts from ISO-8601 to Emacs representation. If ISODURATIONSTRING |
Converts from ISO-8601 to Emacs representation. If ISODURATIONSTRING |
417 |
specifies UTC time (trailing letter Z) the decoded time is given in |
specifies UTC time (trailing letter Z) the decoded time is given in |
418 |
the local time zone! FIXME: TZID-attributes are ignored....! FIXME: |
the local time zone! |
419 |
multiple comma-separated values should be allowed!" |
|
420 |
|
FIXME: TZID-attributes are ignored....! |
421 |
|
FIXME: multiple comma-separated values should be allowed!" |
422 |
(if isodurationstring |
(if isodurationstring |
423 |
(save-match-data |
(save-match-data |
424 |
(string-match |
(string-match |
674 |
;; Export -- convert emacs-diary to icalendar |
;; Export -- convert emacs-diary to icalendar |
675 |
;; ====================================================================== |
;; ====================================================================== |
676 |
|
|
677 |
;; User function |
;;;###autoload |
678 |
(defun icalendar-export-file (diary-filename ical-filename) |
(defun icalendar-export-file (diary-filename ical-filename) |
679 |
"Export diary file to iCalendar format. |
"Export diary file to iCalendar format. |
680 |
All diary entries in the file DIARY-FILENAME are converted to iCalendar |
All diary entries in the file DIARY-FILENAME are converted to iCalendar |
688 |
(defalias 'icalendar-convert-diary-to-ical 'icalendar-export-file) |
(defalias 'icalendar-convert-diary-to-ical 'icalendar-export-file) |
689 |
(make-obsolete 'icalendar-convert-diary-to-ical 'icalendar-export-file) |
(make-obsolete 'icalendar-convert-diary-to-ical 'icalendar-export-file) |
690 |
|
|
691 |
;; User function |
;;;###autoload |
692 |
(defun icalendar-export-region (min max ical-filename) |
(defun icalendar-export-region (min max ical-filename) |
693 |
"Export region in diary file to iCalendar format. |
"Export region in diary file to iCalendar format. |
694 |
All diary entries in the region from MIN to MAX in the current buffer are |
All diary entries in the region from MIN to MAX in the current buffer are |
1114 |
;; Import -- convert icalendar to emacs-diary |
;; Import -- convert icalendar to emacs-diary |
1115 |
;; ====================================================================== |
;; ====================================================================== |
1116 |
|
|
1117 |
;; User function |
;;;###autoload |
1118 |
(defun icalendar-import-file (ical-filename diary-filename |
(defun icalendar-import-file (ical-filename diary-filename |
1119 |
&optional non-marking) |
&optional non-marking) |
1120 |
"Import a iCalendar file and append to a diary file. |
"Import a iCalendar file and append to a diary file. |
1131 |
(set-buffer (find-file ical-filename)) |
(set-buffer (find-file ical-filename)) |
1132 |
(icalendar-import-buffer diary-filename t non-marking))) |
(icalendar-import-buffer diary-filename t non-marking))) |
1133 |
|
|
1134 |
;; User function |
;;;###autoload |
1135 |
(defun icalendar-import-buffer (&optional diary-file do-not-ask |
(defun icalendar-import-buffer (&optional diary-file do-not-ask |
1136 |
non-marking) |
non-marking) |
1137 |
"Extract iCalendar events from current buffer. |
"Extract iCalendar events from current buffer. |
1425 |
((not (string= start-d end-d)) |
((not (string= start-d end-d)) |
1426 |
(icalendar--dmsg "non-recurring event") |
(icalendar--dmsg "non-recurring event") |
1427 |
(let ((ds (icalendar--datetime-to-diary-date dtstart)) |
(let ((ds (icalendar--datetime-to-diary-date dtstart)) |
1428 |
(de (icalendar--datetime-to-diary-date |
(de (icalendar--datetime-to-diary-date dtend))) |
|
(icalendar--decode-isodatetime |
|
|
(icalendar--get-event-property e 'DTEND) |
|
|
-1)))) |
|
1429 |
(setq diary-string |
(setq diary-string |
1430 |
(format "%%%%(and (diary-block %s %s))" |
(format "%%%%(and (diary-block %s %s))" |
1431 |
ds de))) |
ds de))) |