frevvo v11.1 is no longer supported. Please visit the Documentation Directory for our current Cloud Release and other versions.
Working with Dates and Times
- 1.1 Date, Time, Date/Time Formats
- 1.1.1 Date Format
- 1.1.2 Time Format
- 1.1.3 Date/Time Format
- 1.1.4 Date and Time Format on Mobile Devices
- 1.1.5 Date Picker Property
- 1.2 Automatic Locale-Aware Format
- 1.3 Time Zones
- 1.3.1.1 _formTz URL Parameter
- 1.3.1.2 Example
- 1.3.2 Time Zones and Business Rules
- 1.3.2.1 Current Date and Time Functions
- 1.3.2.2 Correct Date and Time Formatting in Rules
- 1.3.2.3 Displayed Values
- 1.1 Date, Time, Date/Time Formats
- 2 Business Rules for Dates and Times
- 3 Initializing Date, Times, and Date/Times from _data or XML Documents
- 4 Use Case Examples
Capturing dates and time accurately is important because frevvo forms and workflows are designed to be used anywhere in the world, streamlining our customer's business processes. This chapter will consolidate information from several other documentation chapters related to working with dates and times in frevvo.
Date, Time, Date/Time Formats
Designers can select formats for Date, Time, and Date/Time controls from a variety of options. The Date Format only controls what the user sees in the form and not what is stored in the submission xml.
Date Format
The Date Format property applies to Date controls and the Date portion of the Date/Time control. The default, recommended format is "Automatic", which is a locale-specific date format. The designer has the option to set a particular date format independent of the locale by using the format field, but this is not recommended. Read this documentation for more information about date controls and internationalization.
Available Date Formats consist of three different separators (dash '-', slash '/', or period '.') and four date display formats (DD/MM/YYYY, MM/DD/YYYY, YYYY/MM/DD, or Mmm/DD/YYYY). European date formatting is supported.
When the Date Format property is set to a specific format, dates entered into the form will be translated and reformatted to match the selected format.
A date typed into a form field will be reformatted to match the selected Date Format
A date entered into a form field will be translated according to the selected format. For example, if you choose a European format of DD-MM-YYYY and the user enters 10-05-2009, the date value will be translated as May 10, 2009. If you choose a US format of MM-DD-YYY the date value will be translated as October 5, 2009.
Any of the three separators will be valid for date entry but will be translated to the selected separator. For example, if you choose a format of MM/DD/YYY and the user enters 10-05-2009, the date will display 10/05/2009.
Dates entered like Feb 3, 2001 will be translated into the specified format.
frevvo adjusts dates expressed with a two-digit year to be within 80 years before or 20 years after. For example, using a pattern of "MM/DD/YY" and the current date/time of Jan 1, 1997, the string "01/11/12" would be interpreted as Jan 11, 2012 while the string "05/04/64" would be interpreted as May 4, 1964. During parsing, only year strings consisting of exactly two digits, will be parsed into the default century. Any other numeric string, such as a one-digit string, a three- or more digit string, or a two-digit string that isn't all digits, is interpreted literally. So "01/02/3" or "01/02/003" are parsed, using the same pattern, as Jan 2, 3 AD. Likewise, "01/02/-3" is parsed as Jan 2, 4 BC. frevvo will always format as 4 digit years.
The date will be converted to the standard xsd:date format of yyyy-mm-dd in the submissions XML document. Here is an example: <Order Date>2012-03-06</Order Date>. Refer to Viewing XML Documents for more details.
Rules can be applied to the Date control in all variations.
Time Format
The Time Format property applies to the Time control type. The default recommended format is "Automatic", which is a locale-specific time format. The designer has the option to set a particular time format independent of the locale by using the format field, but this is not recommended. Read this documentation for more information about time controls and internationalization.
If you keep the default "Automatic" format, you can enter data into a Time control using any of the formats shown in the table. The Time control will accept and display the values as shown:
The Time Format dropdown provides variations of military and standard time conventions, with either colon or period separators.
When the Time Format property is set to a specific format, time entries entered into the form are reformatted to match the selected format. For example, if you choose a military time format of hh:mm:ss and enter 2:00 PM the time value will display in the form as 14:00:00.
The time will be converted to the standard xsd:time format of hh:mm:ss in the submissions XML document. Here is an example: <Order Time>14:00:00</Order Time>. Refer to Viewing XML Documents for more details.
Rules can be applied to the Time control in all variations.
Date/Time Format
Date/Time controls display both the Date Format and Time Format dropdown menus in the properties panel. Rules can be applied to the Date control in all variations. There are some additional considerations for the Date/Time control:
When you enter a date in the date portion of the date/time control (or select the date with the date picker), it will automatically fill the time portion of the control with a value for 12:00 AM. The value displayed depends on the time format selected: For example:
The date picker is included in the date portion of the date/time control. You can hide/disable it by unchecking the Date Picker checkbox on the Style tab.
You cannot enter a time value without a date value.
The time input field cannot be labeled. It is recommended that the label for the date portion be descriptive enough to include the time portion. If the date and time labels over the appropriate input fields are required, two separate controls can be used or the label for the date portion can be extended over the time input field, as shown in the image below:
The local time will be converted to and saved in UTC format and the date will be converted to the standard xsd:datetime format of yyyy-mm-ddThh:mm:ssZ in the submission XML document. Here is an example: <OrderDate>2013-08-12T19:13:00Z</OrderDate>. Refer to Viewing XML Documents for more details.
Date and Time Format on Mobile Devices
Mobile devices support limited date, time, and date/time formats. For example, if you have a date control in your form formatted mm/dd/yyyy and you use that control name as a template in the Form Action Message, you will notice that the message displayed after submitting is in the correct format on desktop view, but changes to yyyy-mm-dd on the mobile view. This is expected and may vary by device and OS.
Similarly, if you have a date field with a default date in your form it must be formatted as YYYY-MM-DD in order for it to display correctly on mobile devices.
frevvo recommends enabling the date picker for forms that will be used on mobile devices to ensure the date is selected accurately.
Date Picker Property
To display the date picker, check the checkbox on the Style Property panel. If checked, you will see the date picker inside the date control and the date portion of the date/time input control. The Date Picker's large font makes it easy to see.
Clicking on the today link in the date picker brings you to the current date. If you are looking at another month and you click on the today link, the date picker will automatically bring you to the current month with today’s date highlighted(bold). Select the date to populate the field in your form/workflow. To close the Date Picker, click the close link.
Month and year menus facilitate quick navigation to earlier/later dates. For example, selecting a past date when entering a Date of Birth is much easier when utilizing the dropdown menus. When selecting a date in the past, select the year first.
The Date Picker described above only applies to the desktop view. Date and Date-Time controls on mobile devices display device specific date pickers.
Automatic Locale-Aware Format
frevvo supports localization from the browser's locale setting. frevvo will recognize the browser locale and alter displays and input formats as well as language according to the user's setting. Setting this preference is browser-specific. Refer to this website for information about language preferences and how to change those in a number of popular browsers.
Time Zones
frevvo automatically infers the time zone from the user’s browser time zone upon login or first access (anonymous users). Once a form is loaded in a given time zone, that time zone cannot be changed. When you browse a form's share URL, you will notice that frevvo automatically appends the _formTz parameter to it based on the detected browser time zone. For example, here is the Link (email/web page) for a Contact Form:
https://staging-app.frevvo.com/frevvo/web/tn/frevvodocs/u/e1dd0efb-f368-4e60-937a-fe08849485d5/app/_prvukdAbEeqgkvXTAjBEIA/formtype/_6-LdwPlHEeuztqyQmKh8FQ/popupformBrowsing it in the America/New York Time zone automatically appends the _formTz parameter as follows:
https://staging-app.frevvo.com/frevvo/web/tn/frevvodocs/u/e1dd0efb-f368-4e60-937a-fe08849485d5/app/_prvukdAbEeqgkvXTAjBEIA/formtype/_6-LdwPlHEeuztqyQmKh8FQ/popupform?_formTz=America%252FNew_YorkBrowsing the same URL in the Africa/Lagos time zone automatically appends the _formTz parameter as follows:
https://staging-app.frevvo.com/frevvo/web/tn/frevvodocs/u/e1dd0efb-f368-4e60-937a-fe08849485d5/app/_prvukdAbEeqgkvXTAjBEIA/formtype/_6-LdwPlHEeuztqyQmKh8FQ/popupform?_formTz=Africa%252FLagosReview how frevvo stores Date, Time and Date/Time values in the submission document.
Imagine that a user in New York enters the date, time and a date/time on the first step in a workflow.
A subsequent step will be viewed by the assigned user in a different time zone. Here is the exact form above viewed in Paris' time zone. The Date and Time controls display their values exactly as entered above. However, because Date/Time controls rely on the browser time zone, the Date/Time originally entered in New York as '10:43 AM' is displayed in Paris time as '3:43 PM'.
_formTz URL Parameter
It is possible to override the browser time zone by appending the &_formTz=<tz> parameter to the form URL. Replace <tz> with a Modern Time Zone String (See this list of tz database time zones). Other time zone formats are not supported.
The _formTz parameter is automatically set to the user's browser time zone upon login or first access (anonymous users). It is only necessary to provide it in the share link if wish to override the user's time zone.
Example
Here is a Product Order form running in the PST time zone, but with the &_formTz=America/Tijuana. The _formTz parameter overrides the browser time zone, and the form displays the date/time control data in the America/Tijuana time zone.
http://localhost:8082/frevvo/web/tn/qa.com/user/rap1/app/_cm8JIGR7EeG4D7_jeDNSHQ/formtype/_XyC2wGbsEeG2-p_Sm3q9pA/popupform?locale=&_formTz=America/TijuanaSome time zones may not return the expected results. This is a known issue with the JVM. Contact Customer Support for assistance.