if (supplied_vevent != NULL) {
vevent = supplied_vevent;
+
+ /* Convert all timestamps to UTC to make them easier to process. */
+ ical_dezonify(vevent);
+
/*
* If we're looking at a fully encapsulated VCALENDAR
* rather than a VEVENT component, attempt to use the first
if (supplied_vevent != NULL) {
vevent = supplied_vevent;
+
+ /* Convert all timestamps to UTC to make them easier to process. */
+ ical_dezonify(vevent);
+
/*
* If we're looking at a fully encapsulated VCALENDAR
* rather than a VEVENT component, attempt to use the first
icaltime_from_webform(&event_start, "dtstart");
}
- /*
- * The following odd-looking snippet of code looks like it
- * takes some unnecessary steps. It is done this way because
- * libical incorrectly turns an "all day event" into a normal
- * event starting at midnight (i.e. it serializes as date/time
- * instead of just date) unless icalvalue_new_date() is used.
- * So we force it, if this is an all day event.
- */
prop = icalproperty_new_dtstart(event_start);
+
if (all_day_event) {
+ /* Force it to serialize as a date-only rather than date/time */
icalproperty_set_value(prop, icalvalue_new_date(event_start));
}
/* First, strip out the parenthesized partstats. */
strcpy(form_attendees, bstr("attendees"));
- stripout(form_attendees, '(', ')');
+ do {
+ i = strlen(form_attendees);
+ stripout(form_attendees, '(', ')');
+ j = strlen(form_attendees);
+ } while (i != j);
/* Next, change any commas to newlines, because we want newline-separated attendees. */
j = strlen(form_attendees);
/* If this was a save or delete, go back to the calendar view. */
if (!havebstr("check_button")) {
- readloop("readfwd");
+ readloop(readfwd);
}
}