XFA Specification
Chapter 23, FormCalc Specification
FormCalc Support for Locale
827
All arguments in an ArgumentList
105
are evaluated in order, leading arguments first. If the number of
mandatory arguments passed to a function is less than the number required, the function generates an
error exception.
Many functions require numeric arguments. If any of the passed arguments are non-numeric, they are
promoted to numbers. Some function arguments only require integral values; in such cases, the passed
arguments are always promoted to integers by truncating the fractional part.
FormCalc Support for Locale
A number of built-in date and time functions are provided, to allow the form designer to do the following:
Select locale-specific date formats (
DateFmt()
and
LocalDateFmt()
)
Parse strings into numbers according to locale-specific date formats (
Date2Num()
)
Get the current date (
Date()
)
Do basic arithmetic on dates
Format numbers into strings, according to locale-specific date picture clauses (
Num2Date()
).
Select locale-specific time formats (
TimeFmt()
and
LocalTimeFmt()
),
Parse strings into numbers according, to locale-specific time picture clauses (
Time2Num()
),
Get the current time (
Time()
)
Do basic arithmetic on times
Format numbers into strings according to locale-specific time formats (
Num2Time()
).
Parse ISO-8601 date strings and time strings into numbers (
IsoDate2Num()
and
IsoTime2Num()
).
To properly parse and format a date or time, we need to do the following:
Prompt the user for dates and times, choosing from a set of conventional styles (date/time format style)
and using symbols appropriate for the users locale to represent the chosen style (localized date/time
format). For example, the conventional date styles include short, medium, long, and full. Further, the
English-language short-style localized date format is “MM/DD/YY”.
Provide the input parser with a picture clause to use for interpreting user-entered values. Picture
clauses serve as a template for converting between user-entered data and canonical data.
Provide an output formatter with a picture clause to use in formatting data for output.
Provide the input parser with a locale identifier to us in the above parsing.
Locales
When developing internationalized applications, a
locale
is the standard term used to identify a particular
nation (language and/or country). A locale defines (but is not limited to) the format of dates, times,
numeric and currency punctuation that are culturally relevant to a specific nation. A properly
internationalized application will always rely on the locale to supply it with the format of dates, and times.
This way, users operating in their locale will always be presented with the date and time formats they are
accustomed to.
“Localization and Canonicalization” on page 140
in the chapter
“Exchanging Data Between an External
Application and a Basic XFA Form”
provides additional information about localization.
Home Index Bookmark Pages
Pages: Home Index All Pages