18. Working with Data Types and Data Display Formats : Date and Time Templates : Absolute Date and Time Templates : Input Masking for Absolute Dates
Share this page                  
Input Masking for Absolute Dates
With input masking turned on, the only valid date template is the absolute date and time template. Input masking does not allow you to use date interval templates. Other restrictions apply, as discussed in Absolute Date and Time Templates (see page Absolute Date and Time Templates).
There must be adequate room in the date input template for all the digits required by the template. For example, you must provide enough space to enter both single‑digit and double‑digit days of the month.
To use single digits for the day, month, or year in your input template, you must do either of the following:
Precede the digit with a space to allow space for possible double‑digit entries
Be sure that the data consists only of a single digit for that component
For example, assume that you specify a format representing the month/day/year with no leading blanks or zeros in front of the digits:
If you turn input masking on, this template is unacceptable because all of the entries can be at least two digits (00/00/00 or 00/00/0000) and the preceding format only allows for the one digit in each part. To specify a format in this manner that is acceptable when input masking is on, you can precede each single digit with a space (d' 2/ 3/ 1') or with a zero (d'02/03/01'). Specifying d' 2/ 3/ 1' causes a blank‑filled date to display in the field prior to user entry; specifying '02/03/01' displays a zero‑filled date prior to user entry.
If you specify a template that is incorrect for use with input masking and turn on input masking, the template is used, if it is otherwise correct, without activating input masking. It does not generate an error message. However, it can compare the entered data to the template only when the user attempts to exit the field. If you correct the template, and input masking is still on, input masking is automatically activated or the next data entered.
You must enter data from left to right in a date field that has input masking turned on. Only numbers in the numeric portions of the template and alphabetic characters in the non‑numeric portions (month and day names) are accepted. If you try to enter an incorrect keystroke in a position, you hear a beep and the keystroke is not entered. The entire date and time string is validated only when you exit the field.