Skip to content

Commit

Permalink
oxcical: avoid emitting allday as YMD when no tzinfo is present
Browse files Browse the repository at this point in the history
The logical day on which an allday event occurs is determined by
applying timezone shift to the timepoint in PR_START_DATE. Without
timezone information, that's not computable.

Fixes: gromox-0~666
Refrences: GXL-323
  • Loading branch information
jengelh committed Sep 22, 2022
1 parent 32e8f22 commit c27a1c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/mapi/oxcical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3571,30 +3571,30 @@ 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)
if (b_allday && g_oxcical_allday_ymd && ptz_component != nullptr)
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);

auto &pilineDTS = pcomponent->append_line("DTSTART", tmp_buff);
if (b_allday && g_oxcical_allday_ymd)
if (b_allday && g_oxcical_allday_ymd && ptz_component != nullptr)
pilineDTS.append_param("VALUE", "DATE");
else if (ptz_component != nullptr)
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)
if (b_allday && g_oxcical_allday_ymd && ptz_component != nullptr)
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);
auto piline = &pcomponent->append_line("DTEND", tmp_buff);
if (b_allday && g_oxcical_allday_ymd)
if (b_allday && g_oxcical_allday_ymd && ptz_component != nullptr)
piline->append_param("VALUE", "DATE");
else if (ptz_component != nullptr)
piline->append_param("TZID", tzid);
Expand Down

0 comments on commit c27a1c5

Please sign in to comment.