TcxSchedulerOccurrenceCalculator.GetNextOccurrence works incorrectly since it ignores VisibleStart property set in constructor. replace "until DateOf(FOccurrenceStart) >= DateOf(FActualStart)" with "until DateOf(FOccurrenceStart) >= DateOf(VisibleStart)" in order to bring the functionality in accordance with docs
Thank you for the suggested code correction, however, it's unclear what the problem is. Please describe the issue in every detail.
In the meantime, I recommend that you take a look at other reports, devoted to the TcxSchedulerOccurrenceCalculator component. For example, refer to report Q19957 ("Obtain Events dates").
perhaps you should read the devex documentation on TcxSchedulerOccurrenceCalculator, that might give you some ideas of the intended functionality of that class. "To specify the time boundaries for the range of reoccurrences to be examined and which recurring user event will be examined use the overloaded Create method". then see description of TcxSchedulerOccurrenceCalculator.Create constructor: "Instantiates the TcxSchedulerOccurrenceCalculator object.
constructor Create(AEvent: TcxSchedulerEvent; const AStart, AFinish: TDateTime);
The AEvent parameter specifies the parent user event (see the Event property);
The AStart and AFinish parameters specify the beginning and ending times of the time range to examine in the chain of occurrences (see the VisibleStart and VisibleFinish properties)."
then if you search through cxSchedulerStorage.pas unit you will see that VisibleStart is never used (though it is initialized in constructor), so instead of [VisibleStart,VisibleFinish] range GetNextOccurrence will return all occurrences from the very beginning of the chain
hope now the idea of intended bugfix is clear for you
there are other bugs in that class as well. GetNextOccurrence incorrectly returns true and OccurrenceStart set outside [VisibleStart;VisibleFinish] range since IsValidOccurrence method is also broken, see comments below
function TcxSchedulerOccurrenceCalculator.IsValidOccurrence: Boolean;
Result := ((FRecurCount >= 0) and (FIndex < FRecurCount)) or // if FRecurCount>=0 it doesn't take into account FinishDate and incorrectly returns true for OccurrenceStart>VisibleFinish in my project
((FRecurCount < 0) and
((DateOf(FOccurrenceStart) <= FFinishDate) or // moreover the whole logic is very vague for me: why in this part it checks FFinishDate instead of VisibleFinish? FFinishDate is set in constructor either equal to FEvent.RecurrenceInfo.Finish or equal to VisibleFinish according to "if FRecurCount = 0" condition, why so?
(FCalcForReminders and (DateOf(FOccurrenceStart) - 14 <= FFinishDate))));
I believe your developers should carefully review that class and fix all those bugs and incosistences
p.s. it looks like there are russian and/or ukrainian staff working on devex so I believe it would be more productive if I could communicate with support/developers speaking russian, what do you think?
Thank you for the additional information. Posting multiple questions within a report makes it difficult to properly track and process such items. May we ask you to open a new issue for each question, suggestion or a bug report you want to post. Thank you for your cooperation.
Although, some engineers here do know Russian, DX is an international company, so we communicate it English. Please be so kind as to write to us in English.
If you wish not to wait for the official update, but to obtain code fixes for certain reports immediately, please feel free to email requests to Support@devexpress.com. For now, this is a common way to get "hot" fixes.
NOTE: This code fix is applied both to v2 and v3 of the ExpressScheduler. When contacting us, please specify which version you need the code fix for.
We're also planning to publish code fixes in future versions of the Support Center. I.e. they will be available immediately for those, who own the source code of our components.
As I understand, our developers have solved the problem mentioned in the subject of this report. So, its state has been changed to Fixed. As I mentioned earlier, posting multiple bugs within a report makes it difficult to properly track and process such items. Please open a new bug report for other bugs, and our developers will resolve them as soon as possible. Thank you for your cooperation.
In any case, thank you for the verification. We're happy to hear that the problem seems to be resolved at your end.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.