Gnus development mailing list
 help / color / mirror / Atom feed
From: Jan Tatarik <jan.tatarik@gmail.com>
To: ding@gnus.org
Subject: Re: iCalendar integration - time zone issue
Date: Thu, 28 Nov 2013 22:20:47 +0100	[thread overview]
Message-ID: <87k3fs2pg0.fsf@nb-jtatarik2.xing.hh> (raw)
In-Reply-To: <87a9gphj2f.fsf@gmail.com> (Mario Peter's message of "Wed, 27 Nov 2013 18:04:56 +0100")

[-- 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)

      parent reply	other threads:[~2013-11-28 21:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11 15:08 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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k3fs2pg0.fsf@nb-jtatarik2.xing.hh \
    --to=jan.tatarik@gmail.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).