CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Issue with OnGetData and Sunday

by Omega8 » 15 Apr 2016 01:11

Hi,
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;
Omega8
 
Posts: 87
Joined: 18 Mar 2016 22:42

by Alexander Bulei » 15 Apr 2016 16:15

Hi,

Please send us the simple testcase.
T.I.A

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQScheduler

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.