The Date Format Policy lets you define specific date and time formats.
Property
|
Description
|
Default Date Format |
Specifies the Date format to use by default. You have two
options:
• | Choose a default format from the list. The formatting styles are
S = Short (completely numeric, such as 12.13.52 or 3:30pm), M = Medium
(longer, such as Jan 12, 1952), and L = Long (even longer, such as
January 12, 1952 or 3:30:32pm). Choosing "M S" would indicate
a Medium Date and a Short Time. | • | Specify a format pattern using format pattern using these date
format characters: d, M, y, h, H, m, s, a, z (day, month, year, 12h,
24h, minutes, seconds, AM/PM, timezone). |
|
Default Date Only Format |
Specifies the Date format to use by default for "Date Only"
data types. This uses the same syntax as Default Date Format. |
Translate Format To User Locale |
Determines whether or not to adapt the Date format to the
User's Locale. This defaults to Yes. |
The next two properties allow a LabVantage database
to assume a fixed format pattern in LabVantage
Queries (meaning Query SDIs). |
Sapphire Query Date Format |
Specifies the Date format used in LabVantage Queries. The
default is M (medium) Date and M (medium) Time, using the Locale specified
on the machine hosting the Application Server.
This must match the format used in the Query's "to_date" function. You have the same two options as in Default Date Format. |
Sapphire Query Date Format Locale |
Specifies the Locale to use for the Date format in LabVantage
Queries. This defaults to the Locale specified on the machine hosting the
Application Server. |
Calendar Lookup First Day of Week |
Specifies the first day of the week in the Calendar Lookup.
Property Name | First Day of Week | User Locale | Set based on the User's Locale. | Sunday | Sunday | Monday | Monday |
|
Calendar Lookup |
Configures the Calendar Lookup.
 | Property Name | First Day of Week | Default Date | Current date shown by the Calendar Lookup by default.
"Always Current Date" defaults to the current system date.
"Field Date Value" defaults to the date value in the field
from which the lookup is opened (if a value already exists).
The Calendar Lookup defaults to the current time (if the field
is empty) or the time in the field (if the field is populated with
date and time) or to midnight (if the field has no time). Time can
be edited in the field or using the Calendar Lookup. Adhoc Queries
compare time specified in the criteria value to the minutes, but
ignore seconds (if any). | Show Time Selector | Determines if the time editor is displayed. | Time Interval in Minutes for Time Selector | Time interval to present the "Select Time of
Day First" choices. | title for Select Time | Text displayed to prompt for a time selection when
the date editor is not displayed. | Text for Select Today | Text displayed for the "Select Today" hyperlink
("Select Today" is the default). | Show Date Editor | If the time editor is shown, this determines if the
date editor is also shown. This disables the "click on date to
select the time" feature. | Time Format for Time Selector | If a custom "Default Date" format is specified,
you must specify the time format portion here. For example, if you
have a Default Date format of "yyyy-MMM-dd H:mm a", you
would enter "H:mm a" here. | Date Format for Date Editor | If a custom "Default Date" format is specified,
you must specify the date format portion here. For example, if you
have Default Date format of "yyyy-MMM-dd H:mm a", you would
enter "yyyy-MMM-dd" here. |
|
Relative Date Format |
Specifies a more friendly date format for past and future dates such as "2 days ago".
Property Name | Description | Past Date Format | Define a Relative Date Format for dates in the past.
Property Name | Description | Identifier | Identifier for this Date Format. | When Less Than | Specify an amount of time between the event, and the current date and time that encompasses the time period you want to represent. This, combined with the Unit (below) determines which relative date format to display. | Unit | Unit of time. Used with When Less Than (above) to determine the Relative Date Format to display. | Format | Format to use when configuring the relative date.
For example: [days] (days) ago |
For example:  | Future Date Format | Define relative Date Formats for dates in the future.
Property Name | Description | Identifier | Identifier for this Date Format. | When Less Than | Specify an amount of time between the event, and the current date and time that encompasses the time period you want to represent. This, combined with the Unit (below) determines which relative date format to display. | Unit | Unit of time. Used with When Less Than (above) to determine the Relative Date Format to display. | Format | Format to use when configuring the relative date. For example, in [minutes] (minutes) |
|
|
• |
Date Lookups use the Date Format Policy's default formats. |
• |
The sapphire.util.DataSet.getValue
method defaults to formats defined in the Policy. If none are defined, the
method defaults to S (Short) and S (Short). |
• |
A Date Lookup accessed in a Query argument returns Date or Date Only format
according to the argument's definition. |
• |
The [defaultdateformat] and [defaultdateonlyformat] Data Types apply
the "Default Date Format" and "Default Date Only Format"
in these areas:
• | Web Page Designer Elements
If the Date Format for a column is not specified, the Date format
defaults the format defined in the Policy (meaning any custom formats
in addition to existing LabVantage Date format support). However,
if the Date Format is specified, it overrides the Policy. | • | Data Entry pages
If the Display Format is not specified for a Parameter, the Date Format
defaults to the Date Format Policy. However, if the Display Format
is specified, it overrides the Policy. |
|
• |
Client-side Date validation recognizes the Date Format Policy's default
formats. |
• |
Class sapphire.util.M18NUtil provides convenient methods for parsing
and date formatting, such as defining "Default Date Only Format"
and determining whether or not to translate to User's Locale. |
Click any of the nodes under the root to display the "Apply and Show Test Formats" button, this lets you view the date formats
for each Locale: