TsDateEdit.CheckValidDate at create-time

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #38014
    remsi
    Participant

    Hello AC-Team,

    see the following code (using AC 13.19):

    Code:
    procedure TForm2.FormCreate(Sender: TObject);
    begin
    sDateEdit1 := TsDateEdit.Create(sPanel1);
    sDateEdit1.Parent := sPanel1;
    sDateEdit1.OnChange := sDateEdit1Change;
    sDateEdit1.DefaultToday := true;
    sDateEdit1Change(nil);
    end;

    procedure TForm2.sDateEdit1Change(Sender: TObject);
    begin
    if (sDateEdit1.CheckValidDate(false)) then
    begin
    sLabel1.Caption := DateToStr(sDateEdit1.Date);
    end;
    end;

    To my opinion executing “DefaultToday := true;” should set the component to a valid date.

    But “CheckValidDate” returns false because the “Text”-property is not filled yet.

    Is this supposed to work like this?

    Greetings,

    Clemens

    #58615
    Support
    Keymaster

    Hello

    I will update the package at the nearest days, your code will work as expected.

    #58668
    remsi
    Participant

    Thank You for fixing it in 14.10!

    Clemens

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.