MarBar77 Posted January 27, 2018 Share Posted January 27, 2018 When I try to change in VCL TUniDateTimePicker.DateFormat from 'dd-MM-yyyy' to 'MM-yyyy' then it does not change. Is there any other way how to change it in runtime many times? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 28, 2018 Share Posted January 28, 2018 Hi, Can you try this approach ?!: 1. type TExUniDateTimePicker = class(TUniDateTimePicker) end; 2. procedure TMainForm.UniButton1Click(Sender: TObject); var dt: TUniDateTimePicker; begin dt := UniDateTimePicker1; with dt do begin DateFormat:='MM/yyyy'; JSInterface.JSAssign('format', [TExUniDateTimePicker(dt).GetJSFormat(DateFormat)]); JSInterface.JSCode(#1'.setValue('#1'.value);'); end; end; Quote Link to comment Share on other sites More sharing options...
MarBar77 Posted January 28, 2018 Author Share Posted January 28, 2018 Sorry, does not work. After this DateTimePicker TextField is empty after calling this code. 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.