Skip to content

Commit c27a1c5

Browse files
committed
oxcical: avoid emitting allday as YMD when no tzinfo is present
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
1 parent 32e8f22 commit c27a1c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/mapi/oxcical.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3571,30 +3571,30 @@ static const char *oxcical_export_internal(const char *method, const char *tzid,
35713571
if (!ical_utc_to_datetime(ptz_component, start_time, &itime))
35723572
return "E-2221";
35733573
char tmp_buff[1024];
3574-
if (b_allday && g_oxcical_allday_ymd)
3574+
if (b_allday && g_oxcical_allday_ymd && ptz_component != nullptr)
35753575
sprintf_dt(tmp_buff, std::size(tmp_buff), itime);
35763576
else if (ptz_component != nullptr)
35773577
sprintf_dtlcl(tmp_buff, std::size(tmp_buff), itime);
35783578
else
35793579
sprintf_dtutc(tmp_buff, std::size(tmp_buff), itime);
35803580

35813581
auto &pilineDTS = pcomponent->append_line("DTSTART", tmp_buff);
3582-
if (b_allday && g_oxcical_allday_ymd)
3582+
if (b_allday && g_oxcical_allday_ymd && ptz_component != nullptr)
35833583
pilineDTS.append_param("VALUE", "DATE");
35843584
else if (ptz_component != nullptr)
35853585
pilineDTS.append_param("TZID", tzid);
35863586

35873587
if (start_time != end_time) {
35883588
if (!ical_utc_to_datetime(ptz_component, end_time, &itime))
35893589
return "E-2222";
3590-
if (b_allday && g_oxcical_allday_ymd)
3590+
if (b_allday && g_oxcical_allday_ymd && ptz_component != nullptr)
35913591
sprintf_dt(tmp_buff, std::size(tmp_buff), itime);
35923592
else if (ptz_component != nullptr)
35933593
sprintf_dtlcl(tmp_buff, std::size(tmp_buff), itime);
35943594
else
35953595
sprintf_dtutc(tmp_buff, std::size(tmp_buff), itime);
35963596
auto piline = &pcomponent->append_line("DTEND", tmp_buff);
3597-
if (b_allday && g_oxcical_allday_ymd)
3597+
if (b_allday && g_oxcical_allday_ymd && ptz_component != nullptr)
35983598
piline->append_param("VALUE", "DATE");
35993599
else if (ptz_component != nullptr)
36003600
piline->append_param("TZID", tzid);

0 commit comments

Comments
 (0)