[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#29116: 24.5; Parsing dates from VCAL
From: |
Robert Pluim |
Subject: |
bug#29116: 24.5; Parsing dates from VCAL |
Date: |
Mon, 06 Nov 2017 11:01:32 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) |
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