Class sap.ui.core.Configuration.FormatSettingsModule: sap/ui/core/Configuration

extends Object

Encapsulates configuration settings that are related to data formatting/parsing.

Note: When format configuration settings are modified through this class, UI5 only ensures that formatter objects created after that point in time will honor the modifications. To be on the safe side, applications should do any modifications early in their lifecycle or recreate any model/UI that is locale dependent.

Method Summary
sap.ui.core.Configuration.FormatSettings.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.Configuration.FormatSettings with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.core.Configuration.FormatSettings.getMetadata()Returns a metadata object for class sap.ui.core.Configuration.FormatSettings.
getDatePattern()Returns the currently set date pattern or undefined if no pattern has been defined.
getFormatLocale()Returns the locale to be used for formatting.
getLegacyDateCalendarCustomizing()Returns the currently set customizing data for Islamic calendar support
getLegacyDateFormat()Returns the currently set legacy ABAP date format (its id) or undefined if none has been set.
getLegacyNumberFormat()Returns the currently set legacy ABAP number format (its id) or undefined if none has been set.
getLegacyTimeFormat()Returns the currently set legacy ABAP time format (its id) or undefined if none has been set.
getNumberSymbol()Returns the currently set number symbol of the given type or undefined if no symbol has been defined.
getTimePattern()Returns the currently set time pattern or undefined if no pattern has been defined.
setDatePattern(sStyle, sPattern)Defines the preferred format pattern for the given date format style.
setFirstDayOfWeek(iValue)Defines the day used as the first day of the week.
setLegacyDateCalendarCustomizing(aMappings)Allows to specify the customizing data for Islamic calendar support
setLegacyDateFormat(sFormatId)Allows to specify one of the legacy ABAP date formats.
setLegacyNumberFormat(sFormatId)Allows to specify one of the legacy ABAP number format.
setLegacyTimeFormat(sFormatId)Allows to specify one of the legacy ABAP time formats.
setNumberSymbol(sStyle, sSymbol)Defines the string to be used for the given number symbol.
setTimePattern(sStyle, sPattern)Defines the preferred format pattern for the given time format style.
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.core.Configuration.FormatSettings()
Method Detail
sap.ui.core.Configuration.FormatSettings.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.core.Configuration.FormatSettings with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.Object.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.core.Configuration.FormatSettings.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.core.Configuration.FormatSettings.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
getDatePattern()
Returns the currently set date pattern or undefined if no pattern has been defined.
getFormatLocale(): sap.ui.core.Locale
Returns the locale to be used for formatting.

If no such locale has been defined, this method falls back to the language, see Configuration.getLanguage().

If any user preferences for date, time or number formatting have been set, and if no format locale has been specified, then a special private use subtag is added to the locale, indicating to the framework that these user preferences should be applied.

Returns:
{sap.ui.core.Locale} the format locale
getLegacyDateCalendarCustomizing(): object[]
Returns the currently set customizing data for Islamic calendar support
Returns:
{object[]} Returns an array contains the customizing data. Each element in the array has properties: dateFormat, islamicMonthStart, gregDate. For details, please see setLegacyDateCalendarCustomizing
getLegacyDateFormat()
Returns the currently set legacy ABAP date format (its id) or undefined if none has been set.
getLegacyNumberFormat()
Returns the currently set legacy ABAP number format (its id) or undefined if none has been set.
getLegacyTimeFormat()
Returns the currently set legacy ABAP time format (its id) or undefined if none has been set.
getNumberSymbol()
Returns the currently set number symbol of the given type or undefined if no symbol has been defined.
getTimePattern()
Returns the currently set time pattern or undefined if no pattern has been defined.
setDatePattern(sStyle, sPattern): sap.ui.core.Configuration.FormatSettings
Defines the preferred format pattern for the given date format style. Calling this method with a null or undefined pattern removes a previously set pattern.

If a pattern is defined, it will be preferred over patterns derived from the current locale.

See class sap.ui.core.format.DateFormat for details about the pattern syntax.

After changing the date pattern, the framework tries to update localization specific parts of the UI. See the documentation of sap.ui.core.Configuration#setLanguage for details and restrictions.

Parameters:
{string}sStyle must be one of short, medium, long or full.
{string}sPattern the format pattern to be used in LDML syntax.
Returns:
{sap.ui.core.Configuration.FormatSettings} Returns this to allow method chaining
setFirstDayOfWeek(iValue): sap.ui.core.Configuration.FormatSettings
Defines the day used as the first day of the week. The day is set as an integer value between 0 (Sunday) and 6 (Saturday). Calling this method with a null or undefined symbol removes a previously set value.

If a value is defined, it will be preferred over values derived from the current locale.

Usually in the US the week starts on Sunday while in most European countries on Monday. There are special cases where you want to have the first day of week set independent of the user locale.

After changing the first day of week, the framework tries to update localization specific parts of the UI. See the documentation of sap.ui.core.Configuration#setLanguage for details and restrictions.

Parameters:
{number}iValue must be an integer value between 0 and 6
Returns:
{sap.ui.core.Configuration.FormatSettings} Returns this to allow method chaining
setLegacyDateCalendarCustomizing(aMappings): sap.ui.core.Configuration.FormatSettings
Allows to specify the customizing data for Islamic calendar support
Parameters:
{object[]}aMappings contains the customizing data for the support of Islamic calendar.
{string}aMappings[].dateFormat The date format
{string}aMappings[].islamicMonthStart The Islamic date
{string}aMappings[].gregDate The corresponding Gregorian date
Returns:
{sap.ui.core.Configuration.FormatSettings} Returns this to allow method chaining
setLegacyDateFormat(sFormatId): sap.ui.core.Configuration.FormatSettings
Allows to specify one of the legacy ABAP date formats.

This method modifies the date patterns for 'short' and 'medium' style with the corresponding ABAP format. When called with a null or undefined format id, any previously applied format will be removed.

After changing the legacy date format, the framework tries to update localization specific parts of the UI. See the documentation of sap.ui.core.Configuration#setLanguage for details and restrictions.

Note: Iranian date format 'C' is NOT yet supported by UI5. It's accepted by this method for convenience (user settings from ABAP system can be used without filtering), but it's ignored. Instead, the formats from the current format locale will be used and a warning will be logged.

Parameters:
{string}sFormatId id of the ABAP data format (one of '1','2','3','4','5','6','7','8','9','A','B','C')
Returns:
{sap.ui.core.Configuration.FormatSettings} Returns this to allow method chaining
setLegacyNumberFormat(sFormatId): sap.ui.core.Configuration.FormatSettings
Allows to specify one of the legacy ABAP number format.

This method will modify the 'group' and 'decimal' symbols. When called with a null or undefined format id, any previously applied format will be removed.

After changing the legacy number format, the framework tries to update localization specific parts of the UI. See the documentation of sap.ui.core.Configuration#setLanguage for details and restrictions.

Parameters:
{string}sFormatId id of the ABAP number format set (one of ' ','X','Y')
Returns:
{sap.ui.core.Configuration.FormatSettings} Returns this to allow method chaining
setLegacyTimeFormat(sFormatId): sap.ui.core.Configuration.FormatSettings
Allows to specify one of the legacy ABAP time formats.

This method sets the time patterns for 'short' and 'medium' style to the corresponding ABAP formats and sets the day period texts to "AM"/"PM" or "am"/"pm" respectively. When called with a null or undefined format id, any previously applied format will be removed.

After changing the legacy time format, the framework tries to update localization specific parts of the UI. See the documentation of sap.ui.core.Configuration#setLanguage for details and restrictions.

Parameters:
{string}sFormatId id of the ABAP time format (one of '0','1','2','3','4')
Returns:
{sap.ui.core.Configuration.FormatSettings} Returns this to allow method chaining
setNumberSymbol(sStyle, sSymbol): sap.ui.core.Configuration.FormatSettings
Defines the string to be used for the given number symbol. Calling this method with a null or undefined symbol removes a previously set symbol string. Note that an empty string is explicitly allowed.

If a symbol is defined, it will be preferred over symbols derived from the current locale.

See class sap.ui.core.format.NumberFormat for details about the symbols.

After changing the number symbol, the framework tries to update localization specific parts of the UI. See the documentation of sap.ui.core.Configuration#setLanguage for details and restrictions.

Parameters:
{string}sStyle must be one of decimal, group, plusSign, minusSign.
{string}sSymbol will be used to represent the given symbol type
Returns:
{sap.ui.core.Configuration.FormatSettings} Returns this to allow method chaining
setTimePattern(sStyle, sPattern): sap.ui.core.Configuration.FormatSettings
Defines the preferred format pattern for the given time format style. Calling this method with a null or undefined pattern removes a previously set pattern.

If a pattern is defined, it will be preferred over patterns derived from the current locale.

See class sap.ui.core.format.DateFormat for details about the pattern syntax.

After changing the time pattern, the framework tries to update localization specific parts of the UI. See the documentation of sap.ui.core.Configuration#setLanguage for details and restrictions.

Parameters:
{string}sStyle must be one of short, medium, long or full.
{string}sPattern the format pattern to be used in LDML syntax.
Returns:
{sap.ui.core.Configuration.FormatSettings} Returns this to allow method chaining