getTextAsShortDate
getTextAsShortDate(): Date;
The getTextAsShortDate method returns the text in short date format from the text property of a TextBox control converted to a
If the text box is empty, null is returned. If the text is not a valid short date, an exception is raised. Use the isValid method to prevent incomplete date data from generating an exception.
By default, a TextBox control expects dates to be formatted according to the locale that the control is using. This applies when accessing the text property and when the user enters data.
When the
Setting date text by using the setTextFromShortDate method converts the short date into the appropriate string for that locale. Retrieving the short date value by using the getTextAsShortDate method does the reverse. You can therefore use the getTextAsShortDate and setTextFromShortDate methods to access short date text so that JADE handles the locale format for you.