Jump to content

Automatically fill standard datetimepicker pt_BR


robinhodemorais

Recommended Posts

I realized that by default in the unidatetimepicker when you type the day it completes with the month and current year, when you type the day and month it fills the year, this without having to inform the bar, however for the brazil pattern when you type the day and month it does not fill in correctly, for example, if you type 0806 and type tab, it fills 08/06/2020, how do I make it fill correctly according to the Brazilian standard?

datetimerpicker.gif

DateFormat is configured this way: dd / MM / yyyy

Link to comment
Share on other sites

2 hours ago, robinhodemorais said:

I realized that by default in the unidatetimepicker when you type the day it completes with the month and current year, when you type the day and month it fills the year, this without having to inform the bar, however for the brazil pattern when you type the day and month it does not fill in correctly, for example, if you type 0806 and type tab, it fills 08/06/2020, how do I make it fill correctly according to the Brazilian standard?

Hello,

This post may help you:

 

Link to comment
Share on other sites

perfect, I made some adjustments according to my standard and it worked correctly ...

function beforeInit(sender, config)
{
  config.altFormats="dmY|d/m/Y|j/n/Y|j/n/y|j/m/y|d/m/y|j/m/Y|d/n/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|d-m-Y|j-n|j/n";
}

however, I have to do this for each datetimepicker I have on the system, can I do it in a way that replicates for everyone?

Link to comment
Share on other sites

1 hour ago, robinhodemorais said:

perfect, I made some adjustments according to my standard and it worked correctly ...


function beforeInit(sender, config)
{
  config.altFormats="dmY|d/m/Y|j/n/Y|j/n/y|j/m/y|d/m/y|j/m/Y|d/n/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|d-m-Y|j-n|j/n";
}

however, I have to do this for each datetimepicker I have on the system, can I do it in a way that replicates for everyone?

+1

  • Like 1
Link to comment
Share on other sites

16 minutes ago, Sherzod said:

You can try to use this approach, by changing the value to the required.

 

perfect thank you.

MainForm.Script:

Ext.form.field.Date.prototype.altFormats="dmY|d/m/Y|j/n/Y|j/n/y|j/m/y|d/m/y|j/m/Y|d/n/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|d-m-Y|j-n|j/n";

 

  • Like 2
Link to comment
Share on other sites

  • 5 months later...

As far as I remember this was already resolved, but with version 39 it came back

  // CONFIGURING REGIONAL CONFIGURATIONS
  UniGuiApplication.PFmtSettings.ThousandSeparator: = '.';
  UniGuiApplication.PFmtSettings.DecimalSeparator: = ',';
  UniGuiApplication.PFmtSettings.CurrencyDecimals: = 2;
  UniGuiApplication.PFmtSettings.DateSeparator: = '/';
  UniGuiApplication.PFmtSettings.ShortDateFormat: = 'dd / mm / yyyy';
  UniGuiApplication.PFmtSettings.LongDateFormat: = 'dd / mm / yyyy';
  UniGuiApplication.PFmtSettings.TimeSeparator: = ':';
  UniGuiApplication.PFmtSettings.TimeAMString: = 'AM';
  UniGuiApplication.PFmtSettings.TimePMString: = 'PM';
  UniGuiApplication.PFmtSettings.ShortTimeFormat: = 'hh: mm';
  UniGuiApplication.PFmtSettings.LongTimeFormat: = 'hh: mm: ss';
  UniGuiApplication.PFmtSettings.CurrencyString: = 'R $';

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