From 261134dd5cf0ffbb3f50874af3dfb8b56377a205 Mon Sep 17 00:00:00 2001 From: zhangdd_ewan Date: Tue, 11 Jul 2023 11:31:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EgetTimeZoneCityItemArray()?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B5=84=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangdd_ewan --- .../reference/apis/js-apis-i18n.md | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/zh-cn/application-dev/reference/apis/js-apis-i18n.md b/zh-cn/application-dev/reference/apis/js-apis-i18n.md index 2e5ee0921b..293739fa94 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-i18n.md +++ b/zh-cn/application-dev/reference/apis/js-apis-i18n.md @@ -2320,6 +2320,34 @@ getRegionInfoArray(regions: Array<string>, options?: SortOptions): Array&l } ``` +### getTimeZoneCityItemArray10+ + +static getTimeZoneCityItemArray(): Array<TimeZoneCityItem> + +获取时区城市组合信息的数组。 + +**系统接口**:此接口为系统接口。 + +**系统能力**:SystemCapability.Global.I18n + +**返回值:** + +| 类型 | 说明 | +| ----------------- | -------------------- | +| Array<[TimeZoneCityItem](#timezonecityitem10)> | 排序后的时区城市组合信息的数组。 | + +**示例:** + ```js + try { + let timeZoneCityItemArray = i18n.SystemLocaleManager.getTimeZoneCityItemArray(); + for (var i = 0; i < timeZoneCityItemArray.length; i++) { + console.log(timeZoneCityItemArray[i].zoneId + ", " + timeZoneCityItemArray[i].cityId + ", " + timeZoneCityItemArray[i].cityDisplayName + + ", " + timeZoneCityItemArray[i].offset + "\r\n"); + } + } catch(error) { + console.error(`call SystemLocaleManager.getTimeZoneCityItemArray failed, error code: ${error.code}, message: ${error.message}.`); + } + ``` ## LocaleItem10+ @@ -2334,6 +2362,21 @@ SystemLocaleManager对语言或国家地区列表的排序结果信息项。 | displayName | string | 是 | id在SystemLocaleManager的Locale下的表示。| | localName | string | 否 | id的本地名称。 | +## TimeZoneCityItem10+ + +封装时区城市组合信息的类型。 + +**系统能力**:SystemCapability.Global.I18n + +| 名称 | 类型 | 必填 | 说明 | +| --------------- | --------------- | ------ | --------------------------------------- | +| zoneId | string | 是 | 时区Id,例如Asia/Shanghai。 | +| cityId | string | 是 | 城市Id,例如Shanghai。 | +| cityDisplayName | string | 是 | 城市Id在系统Locale下显示的名称。 | +| offset | int | 是 | 时区Id的偏移量。 | +| zoneDisplayName | string | 是 | 时区Id在系统Locale下显示的名称。 | +| rawOffset | int | 否 | 时区Id的行偏移量。 | + ## SuggestionType10+ -- GitLab