Jump to content

I have an error when creating a TUniDateTimePicker at runtime, it lets me enter a date 11/1/2020123456789


eduardosuruagy

Recommended Posts

I have an error when creating a TUniDateTimePicker at runtime, it lets me enter a date 11/1/2020123456789

 

I'm creating it this way:

      cDateTimePicker: = TUniDateTimePicker.Create (sbox);
      cDateTimePicker.Parent: = sbox;
      cDateTimePicker.TabStop: = True;
      cDateTimePicker.Name: = 'A' + formatfloat ('000', QryParametros1IFP_SEQ_PARAMETRO.asInteger);
      cDateTimePicker.Top: = TopTotal - 5;
      cDateTimePicker.Height: = Height;
      cDateTimePicker.Width: = SmallerWidth;
      cDateTimePicker.TabOrder: = _viOrder;
      cDateTimePicker.Font.Size: = Source;
      cDateTimePicker.ClearButton: = True;
      cDateTimePicker.Enabled: = (QryParametros1IFP_INATIVO.AsString <> 'S');
      cDateTimePicker.ClientEvents.UniEvents.Add (
                'beforeInit = function beforeInit (sender, config)' # 13 # 10 '{' # 13 # 10 '// disable' +
                'ar the tip that always' # 233 'shown when hovering over the' +
                'ta)' # 13 # 10 'config.formatText =' # 39 # 39 ';' # 13 # 10 # 13 # 10 '// SET THE CORRECT DATE QUAND' +
                'O TYPE WITHOUT O /' # 13 # 10 'config.altFormats = "dmY | d / m / Y | n / j / Y | n / j / y | m /' +
                'j / y | n / d / y | m / j / Y | n / d / Y | dmy | dmY | d / m | dm | dm | dmy | dmY |' # 65279'd | Ymd | n- ' +
                'j | n / j ";' # 13 # 10 '}');

Link to comment
Share on other sites

28 minutes ago, Sherzod said:

Lamento, inicialmente não prestei atenção à sua pergunta. Você precisa de uma máscara de entrada.

If you look at the video you will notice that the component accepts to enter an invalid date, accepts to enter it 03/11/2020123456789

See the year as it is. This only happens if the component is created at run time.

Link to comment
Share on other sites

1 minute ago, eduardosuruagy said:

If you look at the video you will notice that the component accepts to enter an invalid date, accepts to enter it 03/11/2020123456789

Yes I see. I did not pay attention to what you said "accepts". 

 

3 minutes ago, eduardosuruagy said:

This only happens if the component is created at run time.

I do not think so.

 

It seems to me that this is normal behavior and it is by default.

34 minutes ago, Sherzod said:

You need an input mask.

I will analyze and let you know.

Link to comment
Share on other sites

50 minutes ago, Sherzod said:

"Com Ext JS 6.5, chegou o inputMask. No momento, ele só está disponível no kit de ferramentas Modern, mas o Classic o alcançará em breve."

https://docs.sencha.com/extjs/6.5.0/guides/whats_new/whats_new.html#whats_new-_-whats_new_-_input_masking


Mas parece que esta configuração não funciona corretamente para o Classic.

The theme I'm using is triton.modified

Link to comment
Share on other sites

  • 1 month later...
On 03/11/2020 at 12:13, Sherzod said:

"Com Ext JS 6.5, chegou o inputMask. No momento, ele só está disponível no kit de ferramentas Modern, mas o Classic o alcançará em breve."

https://docs.sencha.com/extjs/6.5.0/guides/whats_new/whats_new.html#whats_new-_-whats_new_-_input_masking


Mas parece que esta configuração não funciona corretamente para o Classic.

Boa tarde, consegue ver alguma coisa sobre isso?

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