Commit 74e9799b authored by Ulf Jasper's avatar Ulf Jasper

Handle missing start-time when importing ical event (Bug#33277)

* lisp/calendar/icalendar.el (icalendar--convert-ical-to-diary): Set
start time only if it is explicitly given in ical.  Do not use
start-time as default for end-time (Bug#33277).

* test/lisp/calendar/icalendar-tests.el (icalendar-import-bug-33277):
New.  Test fix for Bug#33277.
parent 4042dad1
Pipeline #3093 failed with stage
in 55 minutes
......@@ -2095,7 +2095,9 @@ written into the buffer `*icalendar-errors*'."
dtstart-zone))
(start-d (icalendar--datetime-to-diary-date
dtstart-dec))
(start-t (icalendar--datetime-to-colontime dtstart-dec))
(start-t (and dtstart
(> (length dtstart) 8)
(icalendar--datetime-to-colontime dtstart-dec)))
(dtend (icalendar--get-event-property e 'DTEND))
(dtend-zone (icalendar--find-time-zone
(icalendar--get-event-property-attributes
......@@ -2148,8 +2150,7 @@ written into the buffer `*icalendar-errors*'."
(icalendar--get-event-property-attributes
e 'DTEND))
"DATE")))
(icalendar--datetime-to-colontime dtend-dec)
start-t))
(icalendar--datetime-to-colontime dtend-dec)))
(icalendar--dmsg "start-d: %s, end-d: %s" start-d end-d)
(cond
;; recurring event
......
......@@ -1300,6 +1300,24 @@ UID:9188710a-08a7-4061-bae3-d4cf4972599a
"
))
(ert-deftest icalendar-import-bug-33277 ()
;;bug#33277 -- start time equals end time
(icalendar-tests--test-import
"DTSTART:20181105T200000Z
DTSTAMP:20181105T181652Z
DESCRIPTION:
LAST-MODIFIED:20181105T181646Z
LOCATION:
SEQUENCE:0
SUMMARY:event with same start/end time
TRANSP:OPAQUE
"
"&2018/11/5 21:00 event with same start/end time\n"
"&5/11/2018 21:00 event with same start/end time\n"
"&11/5/2018 21:00 event with same start/end time\n"
))
(ert-deftest icalendar-import-multiple-vcalendars ()
(icalendar-tests--test-import
"DTSTART;VALUE=DATE:20110723
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment