Enable the Masked Input
18 Nov 20181 minute to read
DateTimePicker has enableMask property that provides the option to enable the built-in date masking support.
The mask pattern is defined based on the provided date format to the component. If the format is not specified, the mask pattern is formed based on the default format of the current culture.
| Keys | Actions |
|---|---|
| Up / Down arrows | To increment and decrement the selected portion of the date and time. |
| Left / Right arrows and Tab | To navigate the selection from one portion to next portion |
Configure Mask Placeholder
You can change mask placeholder value through property maskPlaceholder. By default, it takes the full name of date and time co-ordinates such as day, month, year, hour etc.
While changing to a culture other than English, ensure that locale text for the concerned culture is loaded through load method of L10n class for mask placeholder values like below.
//load the locale object to set the localized mask placeholder value
L10n.load({
'de': {
'datetimepicker': { day: 'Tag' , month: 'Monat', year: 'Jahr', hour: 'Stunde' ,minute: 'Minute', second:'Sekunden' }
}
});