Point Posted January 14, 2021 Share Posted January 14, 2021 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; Quote Link to comment Share on other sites More sharing options...
VolkovVitalD Posted July 7, 2022 Share Posted July 7, 2022 Hello! I also need to switch the format between date and date/time in runtime. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 7, 2022 Share Posted July 7, 2022 On 1/14/2021 at 1:01 PM, Point said: 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; 1 Quote Link to comment Share on other sites More sharing options...
VolkovVitalD Posted July 8, 2022 Share Posted July 8, 2022 Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.