getTextAsLongDate

getTextAsLongDate(): Date;

The getTextAsLongDate method returns the text in long date format from the text property of a TextBox control converted to a Date value.

If the text box is empty, null is returned. If the text is not a valid long date, an exception is raised. Use the isValid method to prevent incomplete long date data from generating an exception.

By default, a TextBox control expects dates to be formatted according to the current locale. This applies when accessing the text property and when the user enters data.

When the EnhancedLocaleSupport parameter in the [JadeEnvironment] section of the JADE initialization file is not defined or it is set to false, inconsistent results could be returned to the application server when running in JADE thin client mode and there are regional overrides, as all overrides on the application server are suppressed if enhanced locale support is not enabled. By default, formatting of locale data is done on the application server, based on the locale of the corresponding presentation client. For example, if the locale of your application server is set to English (United Kingdom), which has a default long date format of dddd/MMMM/yyyy, and it has been overridden with a long date format of yyyy-MMMM-dddd, this is returned in the default dddd/MMMM/yyyy format.

Setting date text by using the setTextFromLongDate method converts the long date into the appropriate string for that locale. Retrieving the long date value by using the getTextAsLongDate method does the reverse. You can therefore use the getTextAsLongDate and setTextFromLongDate methods to access long date text so that JADE handles the locale format for you.