Jump to content

Big problem with calendar


Cristian87

Recommended Posts

21 minutes ago, Cristian87 said:

Yes thanks..but how do you compare a field date with a format date?

If I understand you correct, this is my function:

Adoquery1.SQL.Add ('SET DATEFORMAT dmy;'

+ ' SELECT * FROM MyTableData'

+ ' WHERE MyDateField = ''' + FormatDateTime ('dd.MM.yyyy HH:mm:ss',Now,MySettings) + ''''

);

Adoquery1.Open;

where MySettings is extremely important, this:

GetLocaleFormatSettings(GetUserDefaultLCID, MySettings); //SysUtils
MySettings.DateSeparator := '.';
MySettings.TimeSeparator := ':';
MySettings.DecimalSeparator := '.';
MySettings.LongTimeFormat := 'HH:mm:ss';
MySettings.ShortDateFormat := 'dd-MM-yyyy';
MySettings.ShortTimeFormat := 'HH:mm';

correct all localsettings for application

Link to comment
Share on other sites

If You want to use parameters:

with Adoquery1.Parameters do begin
            Clear;
            AddParameter.Name := 'MyDatePar';
            ParamValues ['MyDatePar'] := FormatDateTime ('dd.MM.yyyy HH:mm:ss',Now,MySettings);
end;

 

Link to comment
Share on other sites

13 minutes ago, Farshad Mohajeri said:

How do you populate calendar data?

var E : TUniCalendarEvent;

E := Calendar.Events.Add;
E.CalendarId := 1;
E.Title := 'MY TITLE';
E.StartDate := EncodeDate(myQuery.FieldByName('year').asinteger,myQuery.FieldByName('month').asinteger,myQuery.FieldByName('day').asinteger);
E.EndDate :=  E.StartDate;
E.IsAllDay := True;

Link to comment
Share on other sites

  • 1 year later...

Hello,

51 minutes ago, jemmyhatta said:

is there any solution? I also have same problem, the calendar panel wont show the event, even i'm open project in unigui demo calendar panel.

i use uni-1.90.0.1554 and RAD STUDIO 11

 

On 3/26/2021 at 10:30 PM, Farshad Mohajeri said:

Can you reproduce this in a small testcase?

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...