Dojo date input mask

Does dojo have any input mask capabilities, more specifically for dates, or is there a clean javascript solution that does the trick? Something like this jquery plugin .

+4
source share
3 answers

Yes, Dijit DateTextBox will determine the appropriate format (mask?) For the date based on the user locale. You can override this using your own format (see DatePattern) or choose between the corresponding β€œlong” or β€œshort” formats (see FormatLength)

There are other dijit.form widgets (ValidationTextBox options) that will restrict the input of numbers and currencies. Alternatively, you can use ValidationTextBox to specify your own regular expression for things like phone numbers or zip codes.

+4
source

The widget you are looking for is called dijit.form.DateTextBox .

The functionality you are looking for is not called a mask in Dojo, it will be known as a restriction, and yes Dojo supports date range restrictions. For example, if you want to create an input field that should be a date later than July 2010, you can do something like this:

 <input type="text" data-dojo-type="dijit.form.DateTextBox" data-dojo-props='{ required: true, promptMessage:"After July 2010", constraints: {min:"2010-07-01"} }' /> 
+4
source

This plugin is similar to Dijit 's DateTextBox.

+3
source

Source: https://habr.com/ru/post/1388056/


All Articles