提交 eab5ab00 编写于 作者: S shawn_he

update doc

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 e30a368e
...@@ -60,6 +60,7 @@ Creates a Locale object. ...@@ -60,6 +60,7 @@ Creates a Locale object.
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | ------------- | ---- | ---------------------------- | | ------- | ------------- | ---- | ---------------------------- |
| locale | string | Yes | A string containing locale information, including the language, optional script, and region.| | locale | string | Yes | A string containing locale information, including the language, optional script, and region.|
...@@ -80,6 +81,7 @@ Converts locale information to a string. ...@@ -80,6 +81,7 @@ Converts locale information to a string.
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ------ | ----------- | | ------ | ----------- |
| string | String containing locale information.| | string | String containing locale information.|
...@@ -100,6 +102,7 @@ Maximizes information of the **Locale** object. If the script and locale informa ...@@ -100,6 +102,7 @@ Maximizes information of the **Locale** object. If the script and locale informa
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ----------------- | ---------- | | ----------------- | ---------- |
| [Locale](#locale) | **Locale** object with the maximized information.| | [Locale](#locale) | **Locale** object with the maximized information.|
...@@ -120,6 +123,7 @@ Minimizes information of the **Locale** object. If the script and locale informa ...@@ -120,6 +123,7 @@ Minimizes information of the **Locale** object. If the script and locale informa
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ----------------- | ---------- | | ----------------- | ---------- |
| [Locale](#locale) | **Locale** object with the minimized information.| | [Locale](#locale) | **Locale** object with the minimized information.|
...@@ -131,7 +135,7 @@ Minimizes information of the **Locale** object. If the script and locale informa ...@@ -131,7 +135,7 @@ Minimizes information of the **Locale** object. If the script and locale informa
``` ```
## LocaleOptions ## LocaleOptions<sup>9+</sup>
Represents the locale options. Represents the locale options.
...@@ -173,6 +177,7 @@ Creates a **DateTimeOptions** object for the specified locale. ...@@ -173,6 +177,7 @@ Creates a **DateTimeOptions** object for the specified locale.
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | ----------------------------------- | ---- | ---------------------------- | | ------- | ----------------------------------- | ---- | ---------------------------- |
| locale | string \| Array&lt;string&gt; | Yes | A string containing locale information, including the language, optional script, and region.| | locale | string \| Array&lt;string&gt; | Yes | A string containing locale information, including the language, optional script, and region.|
...@@ -199,11 +204,13 @@ Formats the specified date and time. ...@@ -199,11 +204,13 @@ Formats the specified date and time.
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---- | ---- | ---- | ------- | | ---- | ---- | ---- | ------- |
| date | Date | Yes | Date and time to be formatted.| | date | Date | Yes | Date and time to be formatted.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ------ | ------------ | | ------ | ------------ |
| string | A string containing the formatted date and time.| | string | A string containing the formatted date and time.|
...@@ -225,12 +232,14 @@ Formats the specified date range. ...@@ -225,12 +232,14 @@ Formats the specified date range.
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| --------- | ---- | ---- | -------- | | --------- | ---- | ---- | -------- |
| startDate | Date | Yes | Start date and time to be formatted.| | startDate | Date | Yes | Start date and time to be formatted.|
| endDate | Date | Yes | End date and time to be formatted.| | endDate | Date | Yes | End date and time to be formatted.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ------ | -------------- | | ------ | -------------- |
| string | A string containing the formatted date and time range.| | string | A string containing the formatted date and time range.|
...@@ -253,6 +262,7 @@ Obtains the formatting options for **DateTimeFormat** object. ...@@ -253,6 +262,7 @@ Obtains the formatting options for **DateTimeFormat** object.
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ----------------------------------- | ----------------------------- | | ----------------------------------- | ----------------------------- |
| [DateTimeOptions](#datetimeoptions) | Formatting options for **DateTimeFormat** objects.| | [DateTimeOptions](#datetimeoptions) | Formatting options for **DateTimeFormat** objects.|
...@@ -264,7 +274,7 @@ Obtains the formatting options for **DateTimeFormat** object. ...@@ -264,7 +274,7 @@ Obtains the formatting options for **DateTimeFormat** object.
``` ```
## DateTimeOptions ## DateTimeOptions<sup>9+</sup>
Provides the options for the **DateTimeFormat** object. Provides the options for the **DateTimeFormat** object.
...@@ -339,11 +349,13 @@ Formats a number. ...@@ -339,11 +349,13 @@ Formats a number.
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---- | | ------ | ------ | ---- | ---- |
| number | number | Yes | Number to be formatted.| | number | number | Yes | Number to be formatted.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ------ | ---------- | | ------ | ---------- |
| string | Formatted number.| | string | Formatted number.|
...@@ -365,6 +377,7 @@ Obtains the options of the **NumberFormat** object. ...@@ -365,6 +377,7 @@ Obtains the options of the **NumberFormat** object.
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ------------------------------- | --------------------------- | | ------------------------------- | --------------------------- |
| [NumberOptions](#numberoptions) | Formatting options for **NumberFormat** objects.| | [NumberOptions](#numberoptions) | Formatting options for **NumberFormat** objects.|
...@@ -377,7 +390,7 @@ Obtains the options of the **NumberFormat** object. ...@@ -377,7 +390,7 @@ Obtains the options of the **NumberFormat** object.
``` ```
## NumberOptions ## NumberOptions<sup>9+</sup>
Provides the device capability. Provides the device capability.
...@@ -453,12 +466,14 @@ Compares two strings based on the sorting policy of the **Collator** object. ...@@ -453,12 +466,14 @@ Compares two strings based on the sorting policy of the **Collator** object.
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ------------ | | ------ | ------ | ---- | ------------ |
| first | string | Yes | First string to compare. | | first | string | Yes | First string to compare. |
| second | string | Yes | Second string to compare.| | second | string | Yes | Second string to compare.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ------ | ---------------------------------------- | | ------ | ---------------------------------------- |
| number | Comparison result. If the value is a negative number, the first string is before the second string. If the value of number is **0**, the first string is equal to the second string. If the value of number is a positive number, the first string is after the second string.| | number | Comparison result. If the value is a negative number, the first string is before the second string. If the value of number is **0**, the first string is equal to the second string. If the value of number is a positive number, the first string is after the second string.|
...@@ -479,6 +494,7 @@ Returns properties reflecting the locale and collation options of a **Collator** ...@@ -479,6 +494,7 @@ Returns properties reflecting the locale and collation options of a **Collator**
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ----------------------------------- | ----------------- | | ----------------------------------- | ----------------- |
| [CollatorOptions](#collatoroptions) | Properties of the **Collator** object.| | [CollatorOptions](#collatoroptions) | Properties of the **Collator** object.|
...@@ -490,7 +506,7 @@ Returns properties reflecting the locale and collation options of a **Collator** ...@@ -490,7 +506,7 @@ Returns properties reflecting the locale and collation options of a **Collator**
``` ```
## CollatorOptions<sup>8+</sup><a name=collatoroptions></a> ## CollatorOptions<sup>9+</sup>
Represents the properties of a **Collator** object. Represents the properties of a **Collator** object.
...@@ -553,11 +569,13 @@ Obtains a string that represents the singular-plural type of the specified numbe ...@@ -553,11 +569,13 @@ Obtains a string that represents the singular-plural type of the specified numbe
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ------------ | | ---- | ------ | ---- | ------------ |
| n | number | Yes | Number for which the singular-plural type is to be obtained.| | n | number | Yes | Number for which the singular-plural type is to be obtained.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ------ | ---------------------------------------- | | ------ | ---------------------------------------- |
| string | Singular-plural type. The value can be any of the following: **one**, **two**, **few**, **many**, **others**.| | string | Singular-plural type. The value can be any of the following: **one**, **two**, **few**, **many**, **others**.|
...@@ -569,7 +587,7 @@ Obtains a string that represents the singular-plural type of the specified numbe ...@@ -569,7 +587,7 @@ Obtains a string that represents the singular-plural type of the specified numbe
``` ```
## PluralRulesOptions<sup>8+</sup><a name=pluralrulesoptions></a> ## PluralRulesOptions<sup>9+</sup>
Represents the properties of a **PluralRules** object. Represents the properties of a **PluralRules** object.
...@@ -611,7 +629,8 @@ Creates a **RelativeTimeFormat** object. ...@@ -611,7 +629,8 @@ Creates a **RelativeTimeFormat** object.
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
Parameters **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | ---------------------------------------- | ---- | ---------------------------- | | ------- | ---------------------------------------- | ---- | ---------------------------- |
| locale | string \| Array&lt;string&gt; | Yes | A string containing locale information, including the language, optional script, and region.| | locale | string \| Array&lt;string&gt; | Yes | A string containing locale information, including the language, optional script, and region.|
...@@ -632,12 +651,14 @@ Formats the value and unit based on the specified locale and formatting options. ...@@ -632,12 +651,14 @@ Formats the value and unit based on the specified locale and formatting options.
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ---------------------------------------- | | ----- | ------ | ---- | ---------------------------------------- |
| value | number | Yes | Value to format. | | value | number | Yes | Value to format. |
| unit | string | Yes | Unit to format. The value can be any of the following: **year**, **quarter**, **month**, **week**, **day**, **hour**, **minute**, **second**.| | unit | string | Yes | Unit to format. The value can be any of the following: **year**, **quarter**, **month**, **week**, **day**, **hour**, **minute**, **second**.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ------ | ---------- | | ------ | ---------- |
| string | Relative time after formatting.| | string | Relative time after formatting.|
...@@ -658,12 +679,14 @@ Returns an array of RelativeTimeFormat objects in parts for locale-aware formatt ...@@ -658,12 +679,14 @@ Returns an array of RelativeTimeFormat objects in parts for locale-aware formatt
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ---------------------------------------- | | ----- | ------ | ---- | ---------------------------------------- |
| value | number | Yes | Value to format. | | value | number | Yes | Value to format. |
| unit | string | Yes | Unit to format. The value can be any of the following: **year**, **quarter**, **month**, **week**, **day**, **hour**, **minute**, **second**.| | unit | string | Yes | Unit to format. The value can be any of the following: **year**, **quarter**, **month**, **week**, **day**, **hour**, **minute**, **second**.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Array&lt;object&gt; | An array of **RelativeTimeFormat** objects in parts.| | Array&lt;object&gt; | An array of **RelativeTimeFormat** objects in parts.|
...@@ -684,6 +707,7 @@ Obtains the formatting options for **RelativeTimeFormat** objects. ...@@ -684,6 +707,7 @@ Obtains the formatting options for **RelativeTimeFormat** objects.
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ---------------------------------------- | --------------------------------- | | ---------------------------------------- | --------------------------------- |
| [RelativeTimeFormatResolvedOptions](#relativetimeformatresolvedoptions) | Formatting options for **RelativeTimeFormat** objects.| | [RelativeTimeFormatResolvedOptions](#relativetimeformatresolvedoptions) | Formatting options for **RelativeTimeFormat** objects.|
...@@ -695,7 +719,7 @@ Obtains the formatting options for **RelativeTimeFormat** objects. ...@@ -695,7 +719,7 @@ Obtains the formatting options for **RelativeTimeFormat** objects.
``` ```
## RelativeTimeFormatInputOptions<sup>8+</sup><a name=relativetimeformatinputoptions></a> ## RelativeTimeFormatInputOptions<sup>9+</sup>
Represents the properties of a **RelativeTimeFormat** object. Represents the properties of a **RelativeTimeFormat** object.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册