Class Index | File Index

Classes


Class NameFmt

Creates a formatter that can format person name instances (Name) for display to a user. The options may contain the following properties:

Formatting names is a locale-dependent function, as the order of the components depends on the locale. The following explains some of the details:


Defined in: ilib-full-dyn.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
NameFmt(options)
Method Summary
Method Attributes Method Name and Description
 
format(name)
Format the name for display in the current locale with the options set up in the constructor of this formatter instance.
 
Return the list of components used to format names in this formatter
 
Return the locale for this formatter instance.
 
Return the style of names returned by this formatter
Class Detail
NameFmt(options)
Parameters:
{Object} options
A set of options that govern how the formatter will behave
Method Detail
{string|undefined} format(name)
Format the name for display in the current locale with the options set up in the constructor of this formatter instance.

If the name does not contain all the parts required for the style, those parts will be left blank.

There are two basic styles of formatting: European, and Asian. If this formatter object is set for European style, but an Asian name is passed to the format method, then this method will format the Asian name with a generic Asian template. Similarly, if the formatter is set for an Asian style, and a European name is passed to the format method, the formatter will use a generic European template.

This means it is always safe to format any name with a formatter for any locale. You should always get something at least reasonable as output.

Parameters:
{Name} name
the name to format
Returns:
{string|undefined} the name formatted according to the style of this formatter instance

{string} getComponents()
Return the list of components used to format names in this formatter
Returns:
{string} the list of components

{Locale} getLocale()
Return the locale for this formatter instance.
Returns:
{Locale} the locale instance for this formatter

{string} getStyle()
Return the style of names returned by this formatter
Returns:
{string} the style of names returned by this formatter

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 02 2016 15:53:55 GMT-0800 (PST)