Gnus development mailing list
 help / color / mirror / Atom feed
* iCalendar integration - time zone issue
@ 2013-11-11 15:08 Adam Sjøgren
  2013-11-11 22:58 ` Jan Tatarik
  0 siblings, 1 reply; 11+ messages in thread
From: Adam Sjøgren @ 2013-11-11 15:08 UTC (permalink / raw)
  To: ding

  Hi.


I am throroughly enjoying the integration of emails with text/calendar
parts and Gnus/org-mode. It is really nice that I don't have to open a
remote desktop to a Windows machine to do calendaring.

Recently a problem has popped up (there is always a catch). For some
reason, appointments are shown / stored 1 hour earlier than they were
supposed to in Gnus/org-mode.

So in Gnus I see:

  Time:       <2013-11-15 Fri 13:30-14:00>

but in Outlook the meeting actually is 14:30-15:00.

When I look at the "raw" VCALENDAR entry, I see this:

  DTSTART;TZID=Romance Standard Time:20131115T143000
  DTEND;TZID=Romance Standard Time:20131115T150000

which makes me guess that somehow the code doesn't know that "Romance
Standard Time" is the same as +0100 (CET), which I am in.

Does this sound like a plausible guess, or does Gnus look at some other
fields (instead/as well)? Any ideas for fixing it?

(I don't know why Microsoft insists on using this weird "Romance
Standard Time", but... well no need to digress more.)


  Best regards,

    Adam

-- 
 "I hope you're not going to ask me                           Adam Sjøgren
  to explain a title."                                   asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iCalendar integration - time zone issue
  2013-11-11 15:08 iCalendar integration - time zone issue Adam Sjøgren
@ 2013-11-11 22:58 ` Jan Tatarik
  2013-11-11 23:29   ` Adam Sjøgren
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Tatarik @ 2013-11-11 22:58 UTC (permalink / raw)
  To: ding

On Mon, Nov 11 2013, Adam Sjøgren wrote:

> I am throroughly enjoying the integration of emails with text/calendar
> parts and Gnus/org-mode. It is really nice that I don't have to open a
> remote desktop to a Windows machine to do calendaring.

> Recently a problem has popped up (there is always a catch). For some
> reason, appointments are shown / stored 1 hour earlier than they were
> supposed to in Gnus/org-mode.

> So in Gnus I see:

>   Time:       <2013-11-15 Fri 13:30-14:00>

> but in Outlook the meeting actually is 14:30-15:00.

> When I look at the "raw" VCALENDAR entry, I see this:

>   DTSTART;TZID=Romance Standard Time:20131115T143000
>   DTEND;TZID=Romance Standard Time:20131115T150000

> which makes me guess that somehow the code doesn't know that "Romance
> Standard Time" is the same as +0100 (CET), which I am in.

> Does this sound like a plausible guess, or does Gnus look at some other
> fields (instead/as well)? Any ideas for fixing it?

Can you post the whole vcalendar? That would help.

In any case, there should be a VTIMEZONE section with a definition of
the timezone used in DTSTART. Something like

BEGIN:VTIMEZONE
TZID:W. Europe Standard Time
BEqGIN:STANDARD
DTSTART:16010101T030000
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE

If there's no definition for the Romance Standard Time, gnus-icalendar
won't be able to adjust for the DTSTART/DTEND timezones.

If the definitions is there, then we have a bug and I would be doubly
interested in the actual VCALENDAR contents.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iCalendar integration - time zone issue
  2013-11-11 22:58 ` Jan Tatarik
@ 2013-11-11 23:29   ` Adam Sjøgren
  2013-11-12  9:07     ` Jan Tatarik
  0 siblings, 1 reply; 11+ messages in thread
From: Adam Sjøgren @ 2013-11-11 23:29 UTC (permalink / raw)
  To: ding

Jan Tatarik <jan.tatarik@gmail.com> writes:

> Can you post the whole vcalendar? That would help.

Sure, here it comes (with some of the content removed to protect the
innocent):

  BEGIN:VCALENDAR
  METHOD:REQUEST
  PRODID:Microsoft Exchange Server 2007
  VERSION:2.0
  BEGIN:VTIMEZONE
  TZID:Romance Standard Time
  BEGIN:STANDARD
  DTSTART:16010101T030000
  TZOFFSETFROM:+0200
  TZOFFSETTO:+0100
  RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
  END:STANDARD
  BEGIN:DAYLIGHT
  DTSTART:16010101T020000
  TZOFFSETFROM:+0100
  TZOFFSETTO:+0200
  RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
  END:DAYLIGHT
  END:VTIMEZONE
  BEGIN:VEVENT
  ORGANIZER;removed
  ATTENDEE;removed a bunch
  DESCRIPTION;LANGUAGE=en-US:removed
  SUMMARY;LANGUAGE=en-US:removed
  DTSTART;TZID=Romance Standard Time:20131115T143000
  DTEND;TZID=Romance Standard Time:20131115T150000
  UID:040000008200E00074C5B7101A82E00800000000B044F3F9F0DECE01000000000000000
   010000000C9E580470F22F44D8DD31ABAAEF9D039
  CLASS:PUBLIC
  PRIORITY:5
  DTSTAMP:20131111T142639Z
  TRANSP:OPAQUE
  STATUS:CONFIRMED
  SEQUENCE:1
  LOCATION;LANGUAGE=en-US:removed
  X-MICROSOFT-CDO-APPT-SEQUENCE:1
  X-MICROSOFT-CDO-OWNERAPPTID:2055976925
  X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
  X-MICROSOFT-CDO-INTENDEDSTATUS:FREE
  X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
  X-MICROSOFT-CDO-IMPORTANCE:1
  X-MICROSOFT-CDO-INSTTYPE:0
  BEGIN:VALARM
  ACTION:DISPLAY
  DESCRIPTION:REMINDER
  TRIGGER;RELATED=START:-PT15M
  END:VALARM
  END:VEVENT
  END:VCALENDAR

> In any case, there should be a VTIMEZONE section with a definition of
> the timezone used in DTSTART.

It looks like there is. I wonder if it is broken...

[...]
> If there's no definition for the Romance Standard Time, gnus-icalendar
> won't be able to adjust for the DTSTART/DTEND timezones.

Makes sense, but it must be finding something, since an hour is
subtracted, right?

> If the definitions is there, then we have a bug and I would be doubly
> interested in the actual VCALENDAR contents.

I hope this is useful - if you need more examples I can extract some.


  Thanks!

    Adam

-- 
 "I hope you're not going to ask me                           Adam Sjøgren
  to explain a title."                                   asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iCalendar integration - time zone issue
  2013-11-11 23:29   ` Adam Sjøgren
@ 2013-11-12  9:07     ` Jan Tatarik
  2013-11-12  9:14       ` Adam Sjøgren
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Tatarik @ 2013-11-12  9:07 UTC (permalink / raw)
  To: ding

On Tue, Nov 12 2013, Adam Sjøgren wrote:


[...]


>> In any case, there should be a VTIMEZONE section with a definition of
>> the timezone used in DTSTART.

> It looks like there is. I wonder if it is broken...

No, it isn't. It's exactly the same as my W. Europe example, only the
name is different.


> [...]
>> If there's no definition for the Romance Standard Time, gnus-icalendar
>> won't be able to adjust for the DTSTART/DTEND timezones.

> Makes sense, but it must be finding something, since an hour is
> subtracted, right?

Yes, this part of the code works fine, the problem occurs later in the
pipeline, when the org timestamp is generated. The actual timezone is
not used when creating the timestamp, so GMT is assumed by default, and
the 1 hour shift happens.

I'll fix that.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iCalendar integration - time zone issue
  2013-11-12  9:07     ` Jan Tatarik
@ 2013-11-12  9:14       ` Adam Sjøgren
  2013-11-12 13:08         ` Jan Tatarik
  0 siblings, 1 reply; 11+ messages in thread
From: Adam Sjøgren @ 2013-11-12  9:14 UTC (permalink / raw)
  To: ding

Jan Tatarik <jan.tatarik@gmail.com> writes:

> No, it isn't. It's exactly the same as my W. Europe example, only the
> name is different.

Ok, good. It looks thoroughly confusing to me.

> Yes, this part of the code works fine, the problem occurs later in the
> pipeline, when the org timestamp is generated. The actual timezone is
> not used when creating the timestamp, so GMT is assumed by default, and
> the 1 hour shift happens.

> I'll fix that.

Great! Thanks a heap.


  :-),

   Adam

-- 
 "I hope you're not going to ask me                           Adam Sjøgren
  to explain a title."                                   asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iCalendar integration - time zone issue
  2013-11-12  9:14       ` Adam Sjøgren
@ 2013-11-12 13:08         ` Jan Tatarik
  2013-11-12 17:27           ` Adam Sjøgren
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Tatarik @ 2013-11-12 13:08 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 639 bytes --]

On Tue, Nov 12 2013, Adam Sjøgren wrote:

> Jan Tatarik <jan.tatarik@gmail.com> writes:

>> No, it isn't. It's exactly the same as my W. Europe example, only the
>> name is different.

> Ok, good. It looks thoroughly confusing to me.

>> Yes, this part of the code works fine, the problem occurs later in the
>> pipeline, when the org timestamp is generated. The actual timezone is
>> not used when creating the timestamp, so GMT is assumed by default, and
>> the 1 hour shift happens.

>> I'll fix that.

OK, have something that works for me. Do you mind testing?

You can try either a patch against the latest gnus


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tz_handling.patch --]
[-- Type: text/x-diff, Size: 4510 bytes --]

diff --git a/lisp/gnus-icalendar.el b/lisp/gnus-icalendar.el
index 969c868b5647158922f9873a49425678c45fd42f..f3b62381b47e79b7f260d5ad8c46ad498096c7d9 100644
--- a/lisp/gnus-icalendar.el
+++ b/lisp/gnus-icalendar.el
@@ -69,14 +69,14 @@
              :accessor gnus-icalendar-event:location
              :initform ""
              :type (or null string))
-   (start :initarg :start
-          :accessor gnus-icalendar-event:start
+   (start-time :initarg :start-time
+          :accessor gnus-icalendar-event:start-time
           :initform ""
-          :type (or null string))
-   (end :initarg :end
-        :accessor gnus-icalendar-event:end
+          :type (or null t))
+   (end-time :initarg :end-time
+        :accessor gnus-icalendar-event:end-time
         :initform ""
-        :type (or null string))
+        :type (or null t))
    (recur :initarg :recur
           :accessor gnus-icalendar-event:recur
           :initform ""
@@ -125,27 +125,15 @@
     (or (match-string 1 rrule)
         default-interval)))
 
-(defmethod gnus-icalendar-event:start-time ((event gnus-icalendar-event))
-  "Return time value of the EVENT start date."
-  (date-to-time (gnus-icalendar-event:start event)))
-
-(defmethod gnus-icalendar-event:end-time ((event gnus-icalendar-event))
-  "Return time value of the EVENT end date."
-  (date-to-time (gnus-icalendar-event:end event)))
-
+(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 zone-map &optional date-style)
-  (let* ((calendar-date-style (or date-style 'european))
-         (date (icalendar--get-event-property ical field))
-         (date-zone (icalendar--find-time-zone
-                     (icalendar--get-event-property-attributes
-                      ical field)
-                     zone-map))
-         (date-decoded (icalendar--decode-isodatetime date nil date-zone)))
+(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)))
 
-    (concat (icalendar--datetime-to-iso-date date-decoded "-")
-            " "
-            (icalendar--datetime-to-colontime date-decoded))))
+    (date-to-time (timezone-make-date-arpa-standard date nil tz))))
 
 (defun gnus-icalendar-event--find-attendee (ical name-or-email)
   (let* ((event (car (icalendar--all-events ical)))
@@ -166,7 +154,6 @@
 
 (defun gnus-icalendar-event-from-ical (ical &optional attendee-name-or-email)
   (let* ((event (car (icalendar--all-events ical)))
-         (zone-map (icalendar--convert-all-timezones ical))
          (organizer (replace-regexp-in-string
                      "^.*MAILTO:" ""
                      (or (icalendar--get-event-property event 'ORGANIZER) "")))
@@ -180,8 +167,8 @@
                      (gnus-icalendar-event--find-attendee ical attendee-name-or-email)))
          (args (list :method method
                      :organizer organizer
-                     :start (gnus-icalendar-event--decode-datefield event 'DTSTART zone-map)
-                     :end (gnus-icalendar-event--decode-datefield event 'DTEND zone-map)
+                     :start-time (gnus-icalendar-event--decode-datefield event 'DTSTART)
+                     :end-time (gnus-icalendar-event--decode-datefield event 'DTEND)
                      :rsvp (string= (plist-get (cadr attendee) 'RSVP)
                                     "TRUE")))
          (event-class (cond
@@ -363,10 +350,10 @@ Return nil for non-recurring EVENT."
   "Build `org-mode' timestamp from EVENT start/end dates and recurrence info."
   (let* ((start (gnus-icalendar-event:start-time event))
          (end (gnus-icalendar-event:end-time event))
-         (start-date (format-time-string "%Y-%m-%d %a" start t))
-         (start-time (format-time-string "%H:%M" start t))
-         (end-date (format-time-string "%Y-%m-%d %a" end t))
-         (end-time (format-time-string "%H:%M" end t))
+         (start-date (format-time-string "%Y-%m-%d %a" start))
+         (start-time (format-time-string "%H:%M" start))
+         (end-date (format-time-string "%Y-%m-%d %a" end))
+         (end-time (format-time-string "%H:%M" end))
          (org-repeat (gnus-icalendar-event:org-repeat event))
          (repeat (if org-repeat (concat " " org-repeat) "")))
 

[-- Attachment #3: Type: text/plain, Size: 51 bytes --]


or just replace the whole gnus-icalendar.el file


[-- Attachment #4: gnus-icalendar.el --]
[-- Type: application/emacs-lisp, Size: 34926 bytes --]

[-- Attachment #5: Type: text/plain, Size: 20 bytes --]


and restart emacs.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iCalendar integration - time zone issue
  2013-11-12 13:08         ` Jan Tatarik
@ 2013-11-12 17:27           ` Adam Sjøgren
  2013-11-27 17:04             ` Mario Peter
  0 siblings, 1 reply; 11+ messages in thread
From: Adam Sjøgren @ 2013-11-12 17:27 UTC (permalink / raw)
  To: ding

Jan Tatarik <jan.tatarik@gmail.com> writes:

> OK, have something that works for me. Do you mind testing?

> You can try either a patch against the latest gnus

The patch works perfectly for my case.


  Thanks!

    Adam

-- 
 "I hope you're not going to ask me                           Adam Sjøgren
  to explain a title."                                   asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iCalendar integration - time zone issue
  2013-11-12 17:27           ` Adam Sjøgren
@ 2013-11-27 17:04             ` Mario Peter
  2013-11-27 23:54               ` Jan Tatarik
                                 ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Mario Peter @ 2013-11-27 17:04 UTC (permalink / raw)
  To: ding

Hi All,

I have quite the same issue with the following almost all of my
vcalendar attachments. The vcalendar entry below shows up in this way:

Summary:    bla
Location:   Mobil
Time:       <2013-11-28 Thu 10:30-11:30 +1w>
Organizer:  
Attendance: Required
Method:     REQUEST
Status:     Not replied yet

which is wrong and ment to be 1h earlier.

could you help here?


BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft CDO for Microsoft Exchange
VERSION:2.0
BEGIN:VTIMEZONE
TZID:GMT +0100 (Standard) / GMT +0200 (Daylight)
BEGIN:STANDARD
DTSTART:16010101T030000
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20131127T080215Z
DTSTART;TZID="GMT +0100 (Standard) / GMT +0200 (Daylight)":20131128T093000
SUMMARY:bla
UID:040000008200E00074C5B7101A82E00800000000A0AAE05A4FEBCE010000000
 00000000010000000DC2B0D91291C464B89B16F675C780D56
ORGANIZER;CN=
LOCATION:Mobil
DTEND;TZID="GMT +0100 (Standard) / GMT +0200 (Daylight)":20131128T103000
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TH;WKST=MO
DESCRIPTION: Current Issues
SEQUENCE:0
PRIORITY:5
CLASS:
CREATED:20131127T080216Z
LAST-MODIFIED:20131127T080216Z
STATUS:CONFIRMED
TRANSP:OPAQUE
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-INSTTYPE:1
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-OWNERAPPTID:-1948534819
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-ATTENDEE-CRITICAL-CHANGE:20131127T080215Z
X-MICROSOFT-CDO-OWNER-CRITICAL-CHANGE:20131127T080215Z
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT00H15M00S
END:VALARM
END:VEVENT
END:VCALENDAR


thanks in advance

Mario
-- 
Mario Peter
de,pl,en
http://www.mpeter.de




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iCalendar integration - time zone issue
  2013-11-27 17:04             ` Mario Peter
@ 2013-11-27 23:54               ` Jan Tatarik
  2013-11-28 20:22               ` Jan Tatarik
  2013-11-28 21:20               ` Jan Tatarik
  2 siblings, 0 replies; 11+ messages in thread
From: Jan Tatarik @ 2013-11-27 23:54 UTC (permalink / raw)
  To: ding

On Wed, Nov 27 2013, Mario Peter wrote:

> Hi All,

> I have quite the same issue with the following almost all of my
> vcalendar attachments. The vcalendar entry below shows up in this way:

> Summary:    bla
> Location:   Mobil
> Time:       <2013-11-28 Thu 10:30-11:30 +1w>
> Organizer:  
> Attendance: Required
> Method:     REQUEST
> Status:     Not replied yet

> which is wrong and ment to be 1h earlier.

> could you help here?

Will have a look.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iCalendar integration - time zone issue
  2013-11-27 17:04             ` Mario Peter
  2013-11-27 23:54               ` Jan Tatarik
@ 2013-11-28 20:22               ` Jan Tatarik
  2013-11-28 21:20               ` Jan Tatarik
  2 siblings, 0 replies; 11+ messages in thread
From: Jan Tatarik @ 2013-11-28 20:22 UTC (permalink / raw)
  To: ding

On Wed, Nov 27 2013, Mario Peter wrote:

> Hi All,

> I have quite the same issue with the following almost all of my
> vcalendar attachments. The vcalendar entry below shows up in this way:

> Summary:    bla
> Location:   Mobil
> Time:       <2013-11-28 Thu 10:30-11:30 +1w>
> Organizer:  
> Attendance: Required
> Method:     REQUEST
> Status:     Not replied yet

> which is wrong and ment to be 1h earlier.

> could you help here?



[...]

> TZID:GMT +0100 (Standard) / GMT +0200 (Daylight)

[...]

> DTSTART;TZID="GMT +0100 (Standard) / GMT +0200 (Daylight)":20131128T093000

Well, Germany is in the CET timezone. Calendar events sent out by
Exchange insist on calling the Germany timezone pretty much anything but
CET. So far, I have seen Romance, Western Europe Time (which Wikipedia
says is wholly different timezone), and now this...

The timezone-make-date-arpa-standard function will handle all of the
above except your case :( Because of the GMT in the timezone name, the
timestamps in your calendar are parsed as GMT, thus the time shift of 1
hour.

My idea of solving this would be introducing customizable variable
containing mappings from any non-standard TZ identifier to a generally
recognized TZ name.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: iCalendar integration - time zone issue
  2013-11-27 17:04             ` Mario Peter
  2013-11-27 23:54               ` Jan Tatarik
  2013-11-28 20:22               ` Jan Tatarik
@ 2013-11-28 21:20               ` Jan Tatarik
  2 siblings, 0 replies; 11+ messages in thread
From: Jan Tatarik @ 2013-11-28 21:20 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 637 bytes --]

On Wed, Nov 27 2013, Mario Peter wrote:

> Hi All,

> I have quite the same issue with the following almost all of my
> vcalendar attachments. The vcalendar entry below shows up in this way:

> Summary:    bla
> Location:   Mobil
> Time:       <2013-11-28 Thu 10:30-11:30 +1w>
> Organizer:  
> Attendance: Required
> Method:     REQUEST
> Status:     Not replied yet

> which is wrong and ment to be 1h earlier.

> could you help here?

Try the enclosed patch.

After applying/restarting, customize the gnus-icalendar-custom-tz
variable and add the following translation:

  From: GMT +0100 (Standard) / GMT +0200 (Daylight)
  To: CET



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: custom_tz.diff --]
[-- Type: text/x-diff, Size: 1719 bytes --]

diff --git a/lisp/gnus-icalendar.el b/lisp/gnus-icalendar.el
index 56c56f3dd466975da7b23edd257058ff63fb8bfd..12455aff8622101eb93f4378b0564c4f8dfcc0fd 100644
--- a/lisp/gnus-icalendar.el
+++ b/lisp/gnus-icalendar.el
@@ -52,6 +52,22 @@
 ;;; ical-event
 ;;;
 
+(defgroup gnus-icalendar nil
+  "Settings for inline display of iCalendar invitations."
+  :group 'gnus-article
+  :prefix "gnus-icalendar-")
+
+(defcustom gnus-icalendar-custom-tz nil
+  "Translate non-standard timezone names.
+
+Invitations might show with wrong start/end times when the ical
+timestamps contain non-standard timezone names.  If this happens,
+you can tell gnus to translate the timezone name to something
+gnus will recognize."
+  :type '(alist :key-type string :value-type string)
+  :group 'gnus-icalendar)
+
+
 (defclass gnus-icalendar-event ()
   ((organizer :initarg :organizer
               :accessor gnus-icalendar-event:organizer
@@ -143,7 +159,9 @@
 (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)))
+         (tzid (plist-get date-props 'TZID))
+         (tz (or (cdr (assoc tzid gnus-icalendar-custom-tz))
+                 tzid)))
 
     (date-to-time (timezone-make-date-arpa-standard date nil tz))))
 
@@ -639,11 +657,6 @@ is searched."
 ;;; gnus-icalendar
 ;;;
 
-(defgroup gnus-icalendar nil
-  "Settings for inline display of iCalendar invitations."
-  :group 'gnus-article
-  :prefix "gnus-icalendar-")
-
 (defcustom gnus-icalendar-reply-bufname "*CAL*"
   "Buffer used for building iCalendar invitation reply."
   :type '(string)

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-11-28 21:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-11 15:08 iCalendar integration - time zone issue Adam Sjøgren
2013-11-11 22:58 ` Jan Tatarik
2013-11-11 23:29   ` Adam Sjøgren
2013-11-12  9:07     ` Jan Tatarik
2013-11-12  9:14       ` Adam Sjøgren
2013-11-12 13:08         ` Jan Tatarik
2013-11-12 17:27           ` Adam Sjøgren
2013-11-27 17:04             ` Mario Peter
2013-11-27 23:54               ` Jan Tatarik
2013-11-28 20:22               ` Jan Tatarik
2013-11-28 21:20               ` Jan Tatarik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).