@@ -161,7 +301,7 @@ Obtains a **Calendar** object.
...
@@ -161,7 +301,7 @@ Obtains a **Calendar** object.
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| locale | string | Yes| Valid locale value, for example, **zh-Hans-CN**.|
| locale | string | Yes| Valid locale value, for example, **zh-Hans-CN**.|
| type | string | No| Valid calendar type. Currently, the valid types are as follows: buddhist, chinese, coptic, ethiopic, hebrew, gregory, indian, islamic\_civil, islamic\_tbla, islamic\_umalqura, japanese, and persian. If this parameter is left unspecified, the default calendar type of the specified locale is used.|
| type | string | No| Valid calendar type. Currently, the valid types are as follows: **buddhist**, **chinese**, **coptic**, **ethiopic**, **hebrew**, **gregory**, **indian**, **islamic\_civil**, **islamic\_tbla**, **islamic\_umalqura**, **japanese**, and **persian**. If this parameter is left unspecified, the default calendar type of the specified locale is used.|
- Return value
- Return value
| Type| Description|
| Type| Description|
...
@@ -295,7 +435,7 @@ Obtains the start day of a week for this **Calendar** object.
...
@@ -295,7 +435,7 @@ Obtains the start day of a week for this **Calendar** object.
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| number | Start day of a week. The value **1** indicates Sunday, and value **7** indicates Saturday.|
| number | Start day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday.|
- Example
- Example
```
```
...
@@ -315,7 +455,7 @@ Sets the start day of a week for this **Calendar** object.
...
@@ -315,7 +455,7 @@ Sets the start day of a week for this **Calendar** object.
- Parameters
- Parameters
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| value | number | No| Start day of a week. The value **1** indicates Sunday, and value **7** indicates Saturday.|
| value | number | No| Start day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday.|
- Example
- Example
```
```
...
@@ -375,7 +515,7 @@ Obtains the value of the specified field in the **Calendar** object.
...
@@ -375,7 +515,7 @@ Obtains the value of the specified field in the **Calendar** object.
- Parameters
- Parameters
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| field | string | Yes| Value of the specified field in the **Calendar** object. Currently, a valid field can be any of the following: era, year, month, week\_of\_year, week\_of\_month, date, day\_of\_year, day\_of\_week, day\_of\_week\_in\_month, hour, hour\_of\_day, minute, second, millisecond, zone\_offset, dst\_offset, year\_woy, dow\_local, extended\_year, julian\_day, milliseconds\_in\_day, is\_leap\_month.|
| field | string | Yes| Value of the specified field in the **Calendar** object. Currently, a valid field can be any of the following: **era**, **year**, **month**, **week\_of\_year**, **week\_of\_month**, **date**, **day\_of\_year**, **day\_of\_week**, **day\_of\_week\_in\_month**, **hour**, **hour\_of\_day**, **minute**, **second**, **millisecond**, **zone\_offset**, **dst\_offset**, **year\_woy**, **dow\_local**, **extended\_year**, **julian\_day**, **milliseconds\_in\_day**, **is\_leap\_month**.|
- Return value
- Return value
| Type| Description|
| Type| Description|
...
@@ -431,7 +571,7 @@ Checks whether the specified date in this **Calendar** object is a weekend.
...
@@ -431,7 +571,7 @@ Checks whether the specified date in this **Calendar** object is a weekend.
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value **true** indicates that the date is a weekend, and value **false** indicates a weekday.|
| boolean | Returns **true** if the date is a weekend; returns **false** if the date is a weekday.|
- Example
- Example
```
```
...
@@ -482,7 +622,7 @@ Checks whether the format of the specified phone number is valid.
...
@@ -482,7 +622,7 @@ Checks whether the format of the specified phone number is valid.
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value **true** indicates the phone number format is valid, and value **false** indicates the opposite.|
| boolean | Returns **true** if the phone number format is valid; returns **false** otherwise.|
- Example
- Example
```
```
...
@@ -520,21 +660,23 @@ Formats a phone number.
...
@@ -520,21 +660,23 @@ Formats a phone number.
Defines the options for this PhoneNumberFormat object.
Defines the options for this PhoneNumberFormat object.
| type | string | Yes| Yes| Format type of a phone number. The value can be **E164**, **INTERNATIONAL**, **NATIONAL**, or **RFC3966**.<br>**System capability**: SystemCapability.Global.I18n|
| type | string | Yes| Yes| Format type of a phone number. The value can be **E164**, **INTERNATIONAL**, **NATIONAL**, or **RFC3966**.|
| unit | string | Yes| Yes| Name of the measurement unit, for example, **meter**, **inch**, or **cup**.|
| unit | string | Yes| Yes| Name of the measurement unit, for example, **meter**, **inch**, or **cup**.|
| measureSystem | string | Yes| Yes| Measurement system. The value can be **SI**, **US**, or **UK**.<br>**System capability**: SystemCapability.Global.I18n|
| measureSystem | string | Yes| Yes| Measurement system. The value can be **SI**, **US**, or **UK**.|
## Util<sup>8+</sup>
## Util<sup>8+</sup>
...
@@ -568,12 +710,9 @@ Converts one measurement unit into another and formats the unit based on the spe
...
@@ -568,12 +710,9 @@ Converts one measurement unit into another and formats the unit based on the spe
```
```
## IndexUtil<sup>8+</sup>
## getInstance<sup>8+</sup>
### getInstance<sup>8+</sup>
getInstance(): IndexUtil
getInstance(locale?:string): IndexUtil
Creates an **IndexUtil** object.
Creates an **IndexUtil** object.
...
@@ -595,6 +734,9 @@ Creates an **IndexUtil** object.
...
@@ -595,6 +734,9 @@ Creates an **IndexUtil** object.
```
```
## IndexUtil<sup>8+</sup>
### getIndexList<sup>8+</sup>
### getIndexList<sup>8+</sup>
getIndexList(): Array<string>
getIndexList(): Array<string>
...
@@ -617,7 +759,7 @@ Obtains the index list for this **locale** object.
...
@@ -617,7 +759,7 @@ Obtains the index list for this **locale** object.
### addLocale<sup>8+</sup>
### addLocale<sup>8+</sup>
addLocale(locale: string)
addLocale(locale: string): void
Adds the index of the new **locale** object to the index list.
Adds the index of the new **locale** object to the index list.
...
@@ -679,7 +821,7 @@ Checks whether the input character string is composed of digits.
...
@@ -679,7 +821,7 @@ Checks whether the input character string is composed of digits.
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value **true** indicates that the input character is a digit, and value **false** indicates the opposite.|
| boolean | Returns **true** if the input character is a digit; returns **false** otherwise.|
- Example
- Example
```
```
...
@@ -703,7 +845,7 @@ Checks whether the input character is a space.
...
@@ -703,7 +845,7 @@ Checks whether the input character is a space.
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value **true** indicates that the input character is a space, and value **false** indicates the opposite.|
| boolean | Returns **true** if the input character is a space; returns **false** otherwise.|
- Example
- Example
```
```
...
@@ -727,7 +869,7 @@ Checks whether the input character is a white space.
...
@@ -727,7 +869,7 @@ Checks whether the input character is a white space.
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value **true** indicates that the input character is a white space, and value **false** indicates the opposite.|
| boolean | Returns **true** if the input character is a white space; returns **false** otherwise.|
- Example
- Example
```
```
...
@@ -751,7 +893,7 @@ Checks whether the input character is of the right to left (RTL) language.
...
@@ -751,7 +893,7 @@ Checks whether the input character is of the right to left (RTL) language.
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value **true** indicates that the input character is of the RTL language, and value **false** indicates the opposite.|
| boolean | Returns **true** if the input character is of the RTL language; returns **false** otherwise.|
- Example
- Example
```
```
...
@@ -775,7 +917,7 @@ Checks whether the input character is an ideographic character.
...
@@ -775,7 +917,7 @@ Checks whether the input character is an ideographic character.
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value **true** indicates that the input character is an ideographic character, and value **false** indicates the opposite.|
| boolean | Returns **true** if the input character is an ideographic character; returns **false** otherwise.|
- Example
- Example
```
```
...
@@ -799,7 +941,7 @@ Checks whether the input character is a letter.
...
@@ -799,7 +941,7 @@ Checks whether the input character is a letter.
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value **true** indicates that the input character is a letter, and value **false** indicates the opposite.|
| boolean | Returns **true** if the input character is a letter; returns **false** otherwise.|
- Example
- Example
```
```
...
@@ -823,7 +965,7 @@ Checks whether the input character is a lowercase letter.
...
@@ -823,7 +965,7 @@ Checks whether the input character is a lowercase letter.
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value **true** indicates that the input character is a lowercase letter, and value **false** indicates the opposite.|
| boolean | Returns **true** if the input character is a lowercase letter; returns **false** otherwise.|
- Example
- Example
```
```
...
@@ -847,7 +989,7 @@ Checks whether the input character is an uppercase letter.
...
@@ -847,7 +989,7 @@ Checks whether the input character is an uppercase letter.
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value true indicates that the input character is an uppercase letter, and value false indicates the opposite.|
| boolean | Returns **true** if the input character is an uppercase letter; returns **false** otherwise.|
- Example
- Example
```
```
...
@@ -1105,7 +1247,7 @@ Checks whether the position specified by the offset is a text boundary. If **tru
...
@@ -1105,7 +1247,7 @@ Checks whether the position specified by the offset is a text boundary. If **tru
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value **true** indicates that the position specified by the offset is a text boundary, and value **false** indicates the opposite.|
| boolean | Returns **true** if the position specified by the offset is a text boundary; returns **false** otherwise.|
- Example
- Example
```
```
...
@@ -1127,7 +1269,7 @@ Checks whether the 24-hour clock is used.
...
@@ -1127,7 +1269,7 @@ Checks whether the 24-hour clock is used.
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value **true** indicates that the 24-hour clock is used, and value **false** indicates the opposite.|
| boolean | Returns **true** if the 24-hour clock is used; returns **false** otherwise.|
- Example
- Example
```
```
...
@@ -1146,12 +1288,12 @@ Sets the 24-hour clock.
...
@@ -1146,12 +1288,12 @@ Sets the 24-hour clock.
- Parameters
- Parameters
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| option | boolean | Yes| Whether to enable the 24-hour clock. The value **true** means to enable the 24-hour clock, and value **false** means the opposite.|
| option | boolean | Yes| Whether to enable the 24-hour clock. The value **true** means to enable the 24-hour clock, and the value **false** means the opposite.|
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value **true** indicates that the 24-hour clock is enabled, and value **false** indicates the opposite.|
| boolean | Returns **true** if the 24-hour clock is enabled; returns **false** otherwise.|
- Example
- Example
```
```
...
@@ -1177,7 +1319,7 @@ Adds a preferred language to the specified position on the preferred language li
...
@@ -1177,7 +1319,7 @@ Adds a preferred language to the specified position on the preferred language li
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value **true** indicates that the preferred language is successfully added, and value **false** indicates the opposite.|
| boolean | Returns **true** if the preferred language is successfully added; returns **false** otherwise.|
- Example
- Example
```
```
...
@@ -1188,9 +1330,9 @@ Adds a preferred language to the specified position on the preferred language li
...
@@ -1188,9 +1330,9 @@ Adds a preferred language to the specified position on the preferred language li
```
```
## i18n.removeDisplayLanguage<sup>8+</sup>
## i18n.removePreferredLanguage<sup>8+</sup>
removeDisplayLanguage(index: number): boolean
removePreferredLanguage(index: number): boolean
Deletes a preferred language from the specified position on the preferred language list.
Deletes a preferred language from the specified position on the preferred language list.
...
@@ -1204,7 +1346,7 @@ Deletes a preferred language from the specified position on the preferred langua
...
@@ -1204,7 +1346,7 @@ Deletes a preferred language from the specified position on the preferred langua
- Return value
- Return value
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | The value **true** indicates that the preferred language is deleted, and value **false** indicates the opposite.|
| boolean | Returns **true** if the preferred language is deleted; returns **false** otherwise.|
- Example
- Example
```
```
...
@@ -1218,14 +1360,14 @@ Deletes a preferred language from the specified position on the preferred langua
...
@@ -1218,14 +1360,14 @@ Deletes a preferred language from the specified position on the preferred langua