emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r118136: lisp/gnus/gnus-icalendar.el: Support vcal f


From: Katsumi Yamaoka
Subject: [Emacs-diffs] trunk r118136: lisp/gnus/gnus-icalendar.el: Support vcal format timezones
Date: Thu, 16 Oct 2014 22:12:10 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 118136
revision-id: address@hidden
parent: address@hidden
author: Sylvain Chouleur <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Thu 2014-10-16 22:12:03 +0000
message:
  lisp/gnus/gnus-icalendar.el: Support vcal format timezones
modified:
  lisp/gnus/ChangeLog            changelog-20091113204419-o5vbwnq5f7feedwu-1433
  lisp/gnus/gnus-icalendar.el    
gnusicalendar.el-20130801225830-k3bdrwt8427ren1n-1
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2014-10-14 22:13:44 +0000
+++ b/lisp/gnus/ChangeLog       2014-10-16 22:12:03 +0000
@@ -1,3 +1,10 @@
+2014-10-15  Sylvain Chouleur  <address@hidden>
+
+       * gnus-icalendar.el: Support vcal format timezones
+       (gnus-icalendar-event--decode-datefield): use icalendar functions to
+       compute dates with associated timezone
+       (gnus-icalendar-event-from-ical): compute all timezones
+
 2014-10-14  Teodor Zlatanov  <address@hidden>
 
        * gnus-start.el (gnus-save-newsrc-file-check-timestamp): New option to

=== modified file 'lisp/gnus/gnus-icalendar.el'
--- a/lisp/gnus/gnus-icalendar.el       2014-10-06 22:11:44 +0000
+++ b/lisp/gnus/gnus-icalendar.el       2014-10-16 22:12:03 +0000
@@ -141,12 +141,13 @@
 (defmethod gnus-icalendar-event:start ((event gnus-icalendar-event))
   (format-time-string "%Y-%m-%d %H:%M" (gnus-icalendar-event:start-time 
event)))
 
-(defun gnus-icalendar-event--decode-datefield (ical field)
-  (let* ((date (icalendar--get-event-property ical field))
-         (date-props (icalendar--get-event-property-attributes ical field))
-         (tz (plist-get date-props 'TZID)))
-
-    (date-to-time (timezone-make-date-arpa-standard date nil tz))))
+(defun gnus-icalendar-event--decode-datefield (event field zone-map)
+  (let* ((dtdate (icalendar--get-event-property event field))
+         (dtdate-zone (icalendar--find-time-zone
+                       (icalendar--get-event-property-attributes
+                        event field) zone-map))
+         (dtdate-dec (icalendar--decode-isodatetime dtdate nil dtdate-zone)))
+    (apply 'encode-time dtdate-dec)))
 
 (defun gnus-icalendar-event--find-attendee (ical name-or-email)
   (let* ((event (car (icalendar--all-events ical)))
@@ -204,10 +205,11 @@
                               ("REQ-PARTICIPANT" 'required)
                               ("OPT-PARTICIPANT" 'optional)
                               (_                 'non-participant)))
+         (zone-map (icalendar--convert-all-timezones ical))
          (args (list :method method
                      :organizer organizer
-                     :start-time (gnus-icalendar-event--decode-datefield event 
'DTSTART)
-                     :end-time (gnus-icalendar-event--decode-datefield event 
'DTEND)
+                     :start-time (gnus-icalendar-event--decode-datefield event 
'DTSTART zone-map)
+                     :end-time (gnus-icalendar-event--decode-datefield event 
'DTEND zone-map)
                      :rsvp (string= (plist-get (cadr attendee) 'RSVP) "TRUE")
                      :participation-type participation-type
                      :req-participants (car attendee-names)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]