When the OnGetData gets fired in svWeek mode the Sunday value is not included because AEndDate has no time portion so
any events onf Sunday do not show. If changed to svDay and I select Sunday, and change back to svWeek, this time Sunday events are included. I take it that this is because Events are cached. When I change AEndDate to AEndDate:=DateOf(AEndDate)+1-EncodeTime(0,0,1,0);
before loading events from the database, Sunday gets loaded twice if I do the same as above.
The same also happens under svMonth. In both cases AEndDate does not have a time portion whereas AEndDate of svDay has a Time portion namely 23:59:59. I checked this with the code below:
in JQScheduler I have the week start on Monday. For some reason The OnGetData event does not take this into consideration otherwise I think
it would work fine.
- Code: Select all
procedure TIWLimoMainForm.IWSchedulerGetData(Sender: TObject; const AStartDate, AEndDate: TDate; AView: TIWCGJQSchedulerView);
begin
with UserSession.FDEventsTable do
begin
CancelRange;
IndexFieldNames := 'StartTime';
SetRangeStart;
FieldByName('StartTime').Value := AStartDate;
SetRangeEnd;
FieldByName('StartTime').Value := AEndDate; //DateOf(AEndDate)+1-SecondsToDateTime;
ApplyRange;
First;
with IWScheduler.JQSchedulerOptions.EventItems do
begin
Clear;
while not EOF do
begin
TIWLimoPoolEvent.CreateFromDataSet(Add).Free;
Next;
end;
end;
end;
WebApplication.ShowMessage(DateTimeToStr(AEndDate));
end;