Date/Time Fields in Forms and Tables

Configurable forms and tables support two types of date fields: View mode and Edit mode. To define a date field, use the format=date setting. The system always displays dates using the client's locale

The following topics are discussed:

View Mode

In View mode, the date value displays using the lzDate taglib. The other settings applicable for date fields in View mode are Display Format and Display Time. See Settings for Fields in Web Form Objects and Settings for Table Column Objects.

The Display Date format order of precedence is:

  1. The Display Format setting on the form field or table column
  2. The property emxFramework.DateTime.DisplayFormat defined in emxSystem.properties

The Display Time order of precedence for displaying time in date fields is:

  1. The Display Time setting on the form field or table column
  2. The property emxFramework.DateTime.DisplayTime defined in emxSystem.properties

If you set the Display Time setting to true, the time display differs based on the Display Format setting and the client's time Zone.

The order of precedence for time zone is:

  1. User preference setting for time zone
  2. Client's time zone

When the Display Format is either FULL or LONG and Display Time is true, the time shows the client's time zone also. When the user does not set a time zone preference, the display of the time zone includes the Greenwich Mean Time delta (for example, GMT - 05:00) instead of a specific time zone such as EDT. To display a specific time zone such as EDT or PST, users must set a personal time zone preference. If the Display Format is:

Format Example Time Display

0 - FULL

03:00:00 PM EDT or 03:00:00 PM GMT - 05:00

1 - LONG

03:00:00 PM EDT or 03:00:00 PM GMT - 05:00

2 - MEDIUM

03:00:00 PM

3 - SHORT

03:00 PM

Edit Mode

You can make the date field/column editable by setting Editable=true. The Display Format and Display Time settings for date fields in forms or tables are not applicable in Edit mode. The date display uses the Date Format defined by the property emxFramework.DateTime.DisplayFormat in emxSystem.properties. In Edit mode, Display Time is always False. By default, the text box displays as read-only, but users can change the date by clicking the calendar icon.

When you configure the date field/column in View mode to display the time, and the user changes the date in Edit mode using the calendar icon, switching back to View mode displays the modified date with the time reset to midday (12:00 noon).

Here is the date field of a table in Edit mode with MEDIUM Date Format (specified in the emxSystem.properties):



Here is the date field of a table in Edit mode with FULL Date Format (specified in the emxSystem.properties):



Here is the date field of a form in Edit mode with MEDIUM Date Format (specified in the emxSystem.properties):



To make a text box (like the one shown above) manually editable, set the form field or table column Allow Manual Edit = true.

The order of precedence for making the above text box manually editable is:


  • Setting Allow Manual Edit on the form field or table column
  • The property emxFramework.AllowKeyableDates defined in emxSystem.properties.

In a configurable table, the system displays the correct date format under the column header of the field (based on the browser locale). For configurable forms, the system displays it below the text box. This figure shows the date field of a table in Edit mode with MEDIUM Date Format and Allow Manual Edit setting = true in English browser.



This figure shows the date field of a table in Edit mode with FULL Date Format and Allow Manual Edit = true in English browser.



This figure shows the date field of a table in Edit mode with MEDIUM Date Format and Allow Manual Edit = true in French browser.



This figure shows the date field of a form in Edit mode with MEDIUM Date Format and Allow Manual Edit = true in English browser.



Date Comparison in Edit Mode

To support compare date logic for date fields, add a hidden parameter to the web form with the name assigned to the web form field name including the suffix '_msvalue'. If there is a valid display value for the date, the system assigns the hidden parameter with the value that is the equivalent of the displayed date in milliseconds (calculated from midnight, January 1, 1970). The validation methods can then use this hidden parameter value to compare two dates. You can only use this for non-editable date fields.

The hidden parameter gets updated only when you use the out of the box calendar component to change the date. If you change the field type to manual edit, the hidden parameter may not have the updated milliseconds value when the field is manually changed. In this case, the validation method can simply ignore the date compare and must depend on the server side validation. The client side validation can be ignored by checking if the field is read-only.