bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#29116: 24.5; Parsing dates from VCAL


From: Vegard Vesterheim
Subject: bug#29116: 24.5; Parsing dates from VCAL
Date: Mon, 06 Nov 2017 08:45:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

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:

BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:W. Europe 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
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Vegard Ves
 terheim:MAILTO:vegard.vesterheim@uninett.no
DESCRIPTION;LANGUAGE=en-US:Meeting description
 SUMMARY;LANGUAGE=en-US:Re-certification
DTSTART;VALUE=DATE:20171208
DTEND;VALUE=DATE:20171209
UID:040000008200E00074C5B7101A82E00800000000434E72372153D301000000000000000
 010000000B8E13E691E414545A6B9D006B49136EC
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20171101T145345Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
LOCATION;LANGUAGE=en-US:UNINETT 5.etg Perl [vbro.no/Perl] (260.502)
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-OWNERAPPTID:2115701571
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DISALLOW-COUNTER:FALSE
END:VEVENT
END:VCALENDAR
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
    
    (cdr date-props)
    (date-to-time (timezone-make-date-arpa-standard date nil tz))))


-- 
- Vegard V -

reply via email to

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