Jump to content

TUnimDatePicker Selectin Bug


M.Ammar

Recommended Posts

Hi 

I have 3 points regarding UnimDatePicker

1- TUnimDatePicker have a bug sometimes show selection menu at year 2039 although the selected date as in the screen shoot show 27/06/2019, this mainly happen after the form leases focus by showing a side menu or something like that.

2- how can I prevent typing into TUnimDatePicker  only allow selection

3- if any one can help me how to translate buttons and months names to Arabic.

939560655_WhatsAppImage2019-06-28at1_25_21PM.thumb.jpeg.d19174e62d067f6ba2c6ca5d65aec555.jpeg

Regards

Link to comment
Share on other sites

Hi,

9 minutes ago, M.Ammar said:

2- how can I prevent typing into TUnimDatePicker  only allow selection

procedure TMainmForm.UnimFormCreate(Sender: TObject);
begin
  UnimDatePicker1.JSInterface.JSConfig('editable', [False]);
end;

 

  • Like 1
Link to comment
Share on other sites

On 6/28/2019 at 1:52 PM, Sherzod said:

thank you for your help as always you save me, can you please give the code for this at runtime to change with language

function afterCreate(sender)
{
  sender.getPicker().getDoneButton().setText("Done!");
  sender.getPicker().getCancelButton().setText("Cancel!")
}

 

Link to comment
Share on other sites

47 minutes ago, M.Ammar said:

thank you for your help as always you save me, can you please give the code for this at runtime to change with language

Thank you! 

Can you try this approach?

function afterCreate(sender)
{
  var me=sender.getPicker();
  if (me && !Ext.isWindows) { 
      me.getDoneButton().setText("Done!");
      me.getCancelButton().setText("Cancel!");
      
      const newMonthsNames=['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];
      month=me.getSlots().find(x => {return x.name == "month"});
      if (month) {month.data.forEach(function(m, i){m.text=newMonthsNames[i]})}
  }
}

 

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

uniGUI 1537, unimDatePicker

error: me.getDoneButton is not a function

 

function afterCreate(sender)
{
    var me=sender.getPicker();
    if (me && !Ext.isWindows) {        
        me.getDoneButton().setText("OK");
        me.getCancelButton().setText("X")
    }
}

 

Screenshot_9.jpg

Link to comment
Share on other sites

1. Open DevTools.

2. Add new vierual device.

3. Add custom device:

UserAgent: Mozilla/5.0 (Linux; <Android Version>; <Build Tag etc.>) AppleWebKit/<WebKit Rev> (KHTML, like Gecko) Chrome/<Chrome Rev> Mobile Safari/<WebKit Rev>

 

Screenshot_59.jpg

Screenshot_60.jpg

Link to comment
Share on other sites

1 hour ago, x11 said:

I tested on 2 smartphones in Firefox and got this error

 

On 10/23/2020 at 4:45 PM, x11 said:

1. Open DevTools.

2. Add new vierual device.

3. Add custom device:

UserAgent: Mozilla/5.0 (Linux; <Android Version>; <Build Tag etc.>) AppleWebKit/<WebKit Rev> (KHTML, like Gecko) Chrome/<Chrome Rev> Mobile Safari/<WebKit Rev>

Hello,

Then try this:

1. 

type
  TUniPlatforms = set of TUniPlatform;

2. 

  public
    { Public declarations }
    uPlat: TUniPlatforms;

3. 

procedure TMainmForm.UnimFormCreate(Sender: TObject);
begin
  uPlat := UniApplication.UniPlatform;

  if (upMobile in uPlat) then
    UnimDatePicker1.Picker := dptEdge;

end;

 

  • Like 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...