unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Vegard Vesterheim <vegard.vesterheim@uninett.no>
Cc: 29116@debbugs.gnu.org
Subject: bug#29116: 24.5; Parsing dates from VCAL
Date: Mon, 06 Nov 2017 11:01:32 +0100	[thread overview]
Message-ID: <87mv3z20ar.fsf@gmail.com> (raw)
In-Reply-To: <1sfu9r97g9.fsf@voll.uninett.no> (Vegard Vesterheim's message of "Mon, 06 Nov 2017 08:45:10 +0100")

Vegard Vesterheim <vegard.vesterheim@uninett.no> writes:

> On Sun, 05 Nov 2017 11:19:08 +0100 Robert Pluim <rpluim@gmail.com> wrote:
>
>> Vegard Vesterheim <vegard.vesterheim@uninett.no> writes:
>>> Looking at the backtrace it seems that the problem is related to parsing
>>> the date string: "20171208".
>>
>> timezone-parse-date assumes that the time-of-day is present in the
>> string to be parsed, which is not the case here. Looking at the code
>> icalendar should set the time to "00000" in that case. Would you have
>> a complete example VCAL file?
>
> Attached:
>

Thanks for that.

> My naive workaraound for this bug was to modify the function
> gnus-icalendar-event--decode-datafile:
>
> (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)))
>
>     ;; VVWASHERE-start, fix bug in parsing DATE
>     (and (eq (car date-props) 'VALUE)
>          (string= (car (cdr date-props)) "DATE")
>          (setq date (concat date "T00:00")))
>     ;; VVWASHERE-end, fix bug in parsing DATE
>

I thought the spec called for T000000, but if it's working for you,
then leave well enough alone.

>     (cdr date-props)
>     (date-to-time (timezone-make-date-arpa-standard date nil tz))))

Duh, I've been looking at the wrong branch. This looks like it was
fixed by 417cf67485, which is available in the 25.1 release or later.

Robert





  reply	other threads:[~2017-11-06 10:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02  8:57 bug#29116: 24.5; Parsing dates from VCAL Vegard Vesterheim
2017-11-05 10:19 ` Robert Pluim
2017-11-06  7:45   ` Vegard Vesterheim
2017-11-06 10:01     ` Robert Pluim [this message]
2017-11-06 11:16       ` Vegard Vesterheim
2017-11-06 11:19         ` Robert Pluim

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87mv3z20ar.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=29116@debbugs.gnu.org \
    --cc=vegard.vesterheim@uninett.no \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).