Skip to content

Commit

Permalink
oxcical: reorder DTSTART/DTEND export cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jengelh committed Sep 22, 2022
1 parent c27a1c5 commit 35aca1c
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions lib/mapi/oxcical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3571,32 +3571,36 @@ static const char *oxcical_export_internal(const char *method, const char *tzid,
if (!ical_utc_to_datetime(ptz_component, start_time, &itime))
return "E-2221";
char tmp_buff[1024];
if (b_allday && g_oxcical_allday_ymd && ptz_component != nullptr)
if (ptz_component == nullptr)
sprintf_dtutc(tmp_buff, std::size(tmp_buff), itime);
else if (b_allday && g_oxcical_allday_ymd)
sprintf_dt(tmp_buff, std::size(tmp_buff), itime);
else if (ptz_component != nullptr)
sprintf_dtlcl(tmp_buff, std::size(tmp_buff), itime);
else
sprintf_dtutc(tmp_buff, std::size(tmp_buff), itime);
sprintf_dtlcl(tmp_buff, std::size(tmp_buff), itime);

auto &pilineDTS = pcomponent->append_line("DTSTART", tmp_buff);
if (b_allday && g_oxcical_allday_ymd && ptz_component != nullptr)
if (ptz_component == nullptr)
/* nothing */;
else if (b_allday && g_oxcical_allday_ymd)
pilineDTS.append_param("VALUE", "DATE");
else if (ptz_component != nullptr)
else
pilineDTS.append_param("TZID", tzid);

if (start_time != end_time) {
if (!ical_utc_to_datetime(ptz_component, end_time, &itime))
return "E-2222";
if (b_allday && g_oxcical_allday_ymd && ptz_component != nullptr)
if (ptz_component == nullptr)
sprintf_dtutc(tmp_buff, std::size(tmp_buff), itime);
else if (b_allday && g_oxcical_allday_ymd)
sprintf_dt(tmp_buff, std::size(tmp_buff), itime);
else if (ptz_component != nullptr)
sprintf_dtlcl(tmp_buff, std::size(tmp_buff), itime);
else
sprintf_dtutc(tmp_buff, std::size(tmp_buff), itime);
sprintf_dtlcl(tmp_buff, std::size(tmp_buff), itime);
auto piline = &pcomponent->append_line("DTEND", tmp_buff);
if (b_allday && g_oxcical_allday_ymd && ptz_component != nullptr)
if (ptz_component == nullptr)
/* nothing */;
else if (b_allday && g_oxcical_allday_ymd)
piline->append_param("VALUE", "DATE");
else if (ptz_component != nullptr)
else
piline->append_param("TZID", tzid);
}

Expand Down

0 comments on commit 35aca1c

Please sign in to comment.