Jump to content

Recommended Posts

Posted

Hi.

 

When a date is not valid the text option of a datetimepicker component is 31/12/1899.

 

Is there any way to get the real text that the user entered?

 

Thanks.

 

Posted

Hi,

 

For now, you can do it approximately as follows:

 

1.

public
  { Public declarations }
  DateTimeText: string;
end;

2.

function blur(sender, e, eOpts)
{
  ajaxRequest(sender, "_change", ["newValue=" + sender.rawValue])
}

function boxready(sender, width, height, eOpts)
{
  ajaxRequest(sender, "_change", ["newValue=" + sender.rawValue])
}

function change(sender, newValue, oldValue, eOpts)
{
  ajaxRequest(sender, "_change", ["newValue=" + sender.rawValue])
}

3.

procedure TMainForm.UniDateTimePicker1AjaxEvent(Sender: TComponent;
  EventName: string; Params: TUniStrings);
begin
  if EventName = '_change' then
  begin
    DateTimeText := Params.Values['newValue'];
  end;
end;

4.

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  ShowMessage(DateTimeText);
end;

Best regards.

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...