javascriptextjsextjs7

ExtJS 7.3 modern no Vtype available


I'd like to limit the input from users when they enter a time duration:

08:00

or when certain settings are enabled

-08:00

This would be possible with an input mask but the '-' is optional so that is out of the question. I am used to using vtype but this is not available in the modern version and I do not see an alternative


Solution

  • 'vtype' is not available but you can use validators

    validators: /^[0-9]{1,5}[:. ;]{0,1}[0-5][0-9]$/
    

    and for the negative duration

    validators: /^-{0,1}[0-9]{1,5}[:. ;]{0,1}[0-5][0-9]$/