<DateFormat> and
<TimeFormat> elements of a localization file
You can specify any of the following attribute values for the DateFormat
and TimeFormat elements:
shortmediumlong
For example (for the en_US locale):
<DateFormat short="MM/dd/yyyy"
medium="MMM d, yyyy"
long="E, MMM d, yyyy" />
<TimeFormat short="hh:mm aa"
medium="hh:mm aa"
long="hh:mm aa"/>
medium and
long formats. However, Guidewire maps the short
format to the date picker widget, which does not support arbitrary date formats. For a
description of these patterns, refer to the following web sites:
PolicyCenter uses the short form to
recognize dates entered by the user. It uses the other forms to display dates and times.
Using the Short format
Define patterns for the short date and time definitions that result
only in a fixed-length output that matches the pattern length.
In general, dates have three components, year, month, and day, each defined by a specific pattern. Each pattern provides a fixed-width output. For example, the following patterns all provide a fixed-width output. In this case, each output contains the same number of characters as the format pattern.
|
Format |
Pattern |
Output |
|---|---|---|
|
|
|
4 digit output, fixed |
|
|
|
2 digit output, fixed |
|
|
|
2 digit output, fixed |
A pattern that does not work
The following list describes an incorrect, non-fixed-width pattern:
|
Format |
Pattern |
Output |
|---|---|---|
|
|
|
4 digit output, fixed |
|
|
|
variable length output |
|
|
|
2 digit output, fixed |
The pattern MMM does not work as there are languages in which the
abbreviated month string is not three characters in length. Attempting to use this
pattern with a language in which there are abbreviated month strings that are not
three characters in length can cause a validation error.
