TvPlanIt: Fix ical events without end time and with zero duration running forever. GitLab issue #39061

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9089 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-12-16 23:30:40 +00:00
parent 4e6e861a43
commit 58b00ac007

View File

@ -1941,12 +1941,11 @@ begin
if (not ical[i].Checked) or (not (ical[i] is TVpICalEvent)) then
Continue;
startTime := TVpICalEvent(ical[i]).StartTime[false]; // use local times
if TVpICalEvent(ical[i]).IsAllDayEvent then
endTime := trunc(startTime) + 1 - OneSecond
else
endTime := TVpICalEvent(ical[i]).EndTime[false];
if startTime = NO_DATE then
continue;
endTime := TVpICalEvent(ical[i]).EndTime[false];
if (TVpICalEvent(ical[i]).IsAllDayEvent) or (endTime = NO_DATE) then
endTime := trunc(startTime) + 1;
id := dataStore.GetNextID(EventsTableName);
event := AddEvent(id, starttime, endtime - OneSecond);
event.Changed := true;