Jump to content

Change DateTimePicker Format On Runtime


Point

Recommended Posts

 try to change DateTimePicker Format On Runtime, but doesnt work. 

procedure TMainForm.UniRadioGroup1Click(Sender: TObject);
begin
  case UniRadioGroup1.ItemIndex of
    0 : UniDateTimePicker1.DateFormat := 'dd MMMM yyyy';
    1 : UniDateTimePicker1.DateFormat := 'MMMM yyyy';
    2 : UniDateTimePicker1.DateFormat := 'yyyy';
  end;
end;

 

 

uniguidtp.gif

vcldtp1.gif

Link to comment
Share on other sites

  • 1 year later...
On 1/14/2021 at 1:01 PM, Point said:

vcldtp1.gif

Hello,

Sorry for the late reply.

5 hours ago, VolkovVitalD said:

I also need to switch the format between date in runtime...

 

DateMode = dtmDateOnly and Kind = tUniDate:

1. 

Uses ..., uniGUIJSUtils;

2. 

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  with UniDateTimePicker1 do
  begin
    DateFormat := 'MMMM yyyy';

    JSInterface.JSCall('setConfig', [JSInterface.JSObject(['format', PickerToExtDateFormat(DateFormat)])]);
    JSInterface.JSCallDefer('onBlur', [], 10);
  end;
end;

 

  • Like 1
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...