JavaScript/jQuery DateRangeBox - Value Formatting and Masked Input
The DateRangeBox displays values according to the application's locale. You can specify a custom date format. Use the displayFormat property that accepts predefined and custom formats.
If useMaskBehavior is true, the displayFormat property also specifies a mask that restricts user input:
JavaScript
- $(function() {
- $("#dateRangeBoxContainer").dxDateRangeBox({
- displayFormat: "EEEE, MMM d", // "Tuesday, Oct 19 - Sunday, Oct 24"
- useMaskBehavior: true,
- // ...
- });
- });
The following changes apply when masked input is enabled:
- The mouse wheel or Up/Down Arrow key increases/decreases the selected value section by 1.
- The caret moves to the next date section when the previous date section is entered.
- The year is entered right-to-left. For example, enter
2to specify the year2002; enter19for2019. - The corresponding month/day number or initial letters can be used to specify the month and day of the week when they are displayed as text. For example, in the month section, enter
Mor3to specify "March".