Home
last modified time | relevance | path

Searched refs:RelativeTimeFormat (Results 1 – 19 of 19) sorted by relevance

/ohos5.0/base/global/i18n/frameworks/intl/src/
H A Drelative_time_format.cpp24 const char* RelativeTimeFormat::DEVICE_TYPE_NAME = "const.product.devicetype";
32 std::unordered_map<std::string, std::string> RelativeTimeFormat::defaultFormatStyle = {
57 RelativeTimeFormat::RelativeTimeFormat(const std::vector<std::string> &localeTags, in RelativeTimeFormat() function in OHOS::Global::I18n::RelativeTimeFormat
105 RelativeTimeFormat::~RelativeTimeFormat() in ~RelativeTimeFormat()
109 void RelativeTimeFormat::ParseConfigs(std::map<std::string, std::string> &configs) in ParseConfigs()
122 std::string RelativeTimeFormat::Format(double number, const std::string &unit) in Format()
139 void RelativeTimeFormat::InsertInfo(std::vector<std::vector<std::string>> &timeVector, in InsertInfo()
154 void RelativeTimeFormat::ProcessIntegerField(const std::map<size_t, size_t> &indexMap, in ProcessIntegerField()
167 void RelativeTimeFormat::FormatToParts(double number, const std::string &unit, in FormatToParts()
210 void RelativeTimeFormat::GetResolvedOptions(std::map<std::string, std::string> &map) in GetResolvedOptions()
[all …]
H A Dnumber_format.cpp147 relativeTimeFormat = std::make_unique<RelativeTimeFormat>(locales, in CreateRelativeTimeFormat()
/ohos5.0/docs/zh-cn/application-dev/internationalization/
H A Di18n-time-date.md142 格式化相对时间将表示时间日期的Date对象,通过[RelativeTimeFormat](../reference/apis-localization-kit/js-apis-intl.md#rel…
149 2. 创建RelativeTimeFormat对象。
152 …let relativeTimeFormat: intl.RelativeTimeFormat = new intl.RelativeTimeFormat(locale: string | Arr…
196 let relativeTimeFormat1 = new intl.RelativeTimeFormat('en-GB');
200 let relativeTimeFormat2 = new intl.RelativeTimeFormat('en-GB', {numeric: "auto"});
204 let relativeTimeFormat3 = new intl.RelativeTimeFormat('fr-FR'); // 默认style为long
206 let relativeTimeFormat4 = new intl.RelativeTimeFormat('fr-FR', {style: 'narrow'});
210 let relativeTimeFormat5 = new intl.RelativeTimeFormat('en-GB', {style: 'long'});
214 // 获取RelativeTimeFormat对象的格式化选项
215 let relativeTimeFormat6 = new intl.RelativeTimeFormat('en-GB', {numeric: 'auto'});
/ohos5.0/docs/en/application-dev/internationalization/
H A Di18n-time-date.md142 …./reference/apis-localization-kit/js-apis-intl.md#format8) API of [RelativeTimeFormat](../referenc…
149 2. Create a **RelativeTimeFormat** object.
152 …let relativeTimeFormat: intl.RelativeTimeFormat = new intl.RelativeTimeFormat(locale: string | Arr…
196 let relativeTimeFormat1 = new intl.RelativeTimeFormat('en-GB');
200 let relativeTimeFormat2 = new intl.RelativeTimeFormat('en-GB', {numeric: "auto"});
204 let relativeTimeFormat3 = new intl.RelativeTimeFormat('fr-FR'); // The default style is long.
206 let relativeTimeFormat4 = new intl.RelativeTimeFormat('fr-FR', {style: 'narrow'});
210 let relativeTimeFormat5 = new intl.RelativeTimeFormat('en-GB', {style: 'long'});
214 // Obtain the formatting options of RelativeTimeFormat.
215 let relativeTimeFormat6 = new intl.RelativeTimeFormat('en-GB', {numeric: 'auto'});
/ohos5.0/base/global/i18n/frameworks/intl/include/
H A Drelative_time_format.h48 class RelativeTimeFormat {
50RelativeTimeFormat(const std::vector<std::string> &localeTag, std::map<std::string, std::string> &…
51 virtual ~RelativeTimeFormat();
H A Dnumber_format.h89 std::unique_ptr<RelativeTimeFormat> relativeTimeFormat = nullptr;
/ohos5.0/docs/zh-cn/application-dev/reference/apis-localization-kit/
H A Djs-apis-intl.md761 ## RelativeTimeFormat<sup>8+</sup>
775 // 使用系统locale创建RelativeTimeFormat对象
776 let relativetimefmt = new intl.RelativeTimeFormat();
829 // 使用 zh-CN locale创建RelativeTimeFormat对象
830 let relativetimefmt = new intl.RelativeTimeFormat("zh-CN");
861 // 使用 en locale创建RelativeTimeFormat对象,numeric设置为auto
862 let relativetimefmt = new intl.RelativeTimeFormat("en", {"numeric": "auto"});
871 获取RelativeTimeFormat对象的格式化选项。
885 // 使用 en-GB locale创建RelativeTimeFormat对象
887 // 获取RelativeTimeFormat对象配置项
[all …]
/ohos5.0/docs/zh-cn/release-notes/api-diff/v3.1-Release/
H A Djs-apidiff-global.md17 | ohos.intl | RelativeTimeFormat | resolvedOptions(): RelativeTimeFormatResolvedOptions; | 新增 |
18 | ohos.intl | RelativeTimeFormat | formatToParts(value: number, unit: string): Array\<object>; | 新增…
19 | ohos.intl | RelativeTimeFormat | format(value: number, unit: string): string; | 新增 |
20 | ohos.intl | RelativeTimeFormat | constructor(); | 新增 |
/ohos5.0/docs/en/release-notes/api-diff/v3.1-Release/
H A Djs-apidiff-global.md17 | ohos.intl | RelativeTimeFormat | resolvedOptions(): RelativeTimeFormatResolvedOptions; | Added|
18 | ohos.intl | RelativeTimeFormat | formatToParts(value: number, unit: string): Array\<object>; | Ad…
19 | ohos.intl | RelativeTimeFormat | format(value: number, unit: string): string; | Added|
20 | ohos.intl | RelativeTimeFormat | constructor(); | Added|
/ohos5.0/base/global/i18n/frameworks/intl/test/unittest/
H A Dintl_test.cpp1002 RelativeTimeFormat *formatter = new RelativeTimeFormat(locales, options);
1052 RelativeTimeFormat *formatter = new RelativeTimeFormat(locales, options);
1093 RelativeTimeFormat *formatter = new RelativeTimeFormat(locales, options);
1126 RelativeTimeFormat *fmt = new RelativeTimeFormat(locales, options);
1144 RelativeTimeFormat *formatter = new RelativeTimeFormat(locales, options);
1193 RelativeTimeFormat *formatter = new RelativeTimeFormat(locales, options);
H A Dintl_test_extent.cpp658 RelativeTimeFormat *formatter = new RelativeTimeFormat(locales, options);
/ohos5.0/docs/en/application-dev/reference/apis-localization-kit/
H A Djs-apis-intl.md761 ## RelativeTimeFormat<sup>8+</sup>
767 Creates a **RelativeTimeFormat** object.
775 // Use the system locale to create a RelativeTimeFormat object.
776 let relativetimefmt = new intl.RelativeTimeFormat();
784 Creates a **RelativeTimeFormat** object.
829 // Use locale zh-CN to create a RelativeTimeFormat object.
830 let relativetimefmt = new intl.RelativeTimeFormat("zh-CN");
885 // Use locale en-GB to create a RelativeTimeFormat object.
887 // Obtain the options of the RelativeTimeFormat object.
895 Defines the options for creating a **RelativeTimeFormat** object.
[all …]
/ohos5.0/base/global/i18n/frameworks/intl/test/fuzztest/relativetimeformat_fuzzer/
H A Drelativetimeformat_fuzzer.cpp36 RelativeTimeFormat formatter(localeTags, options); in DoSomethingInterestingWithMyAPI()
/ohos5.0/docs/zh-cn/release-notes/api-diff/v4.0-Release to v3.2-Release/
H A Djs-apidiff-global.md218 |跨平台能力有变化|类名:RelativeTimeFormat;<br>方法or属性:constructor();<br>旧版本信息:|类名:RelativeTimeFormat;<br>方法or属…
308 …力有变化|类名:RelativeTimeFormat;<br>方法or属性:export class RelativeTimeFormat<br>旧版本信息:|类名:RelativeTimeFor…
309 …:RelativeTimeFormat;<br>方法or属性:constructor(locale: string \| Array\<string>, options?: RelativeTim…
310 |跨平台能力有变化|类名:RelativeTimeFormat;<br>方法or属性:format(value: number, unit: string): string;<br>旧版本信息:|类…
311 |跨平台能力有变化|类名:RelativeTimeFormat;<br>方法or属性:formatToParts(value: number, unit: string): Array\<objec…
312 |跨平台能力有变化|类名:RelativeTimeFormat;<br>方法or属性:resolvedOptions(): RelativeTimeFormatResolvedOptions;<br…
/ohos5.0/docs/zh-cn/release-notes/api-diff/v3.1-beta/
H A Djs-apidiff-v3.1-beta.md162 | 全球化-Intl | RelativeTimeFormat.constructor(); | 新增 | 构造函数 |
163 | 全球化-Intl | RelativeTimeFormat.constructor(locale: string \| Array\<string>, options?: RelativeTim…
164 | 全球化-Intl | RelativeTimeFormat.format(value: number, unit: string): string; | 新增 | 相对时间格式化 |
165 | 全球化-Intl | RelativeTimeFormat.formatToParts(value: number, unit: string): Array\<object>; | 新增 | …
166 | 全球化-Intl | RelativeTimeFormat.formatToParts(value: number, unit: string): Array\<object>; | 新增 | …
/ohos5.0/base/global/i18n/interfaces/js/kits/include/
H A Dintl_addon.h124 std::unique_ptr<RelativeTimeFormat> relativetimefmt_ = nullptr;
/ohos5.0/docs/en/release-notes/api-diff/v4.0-Release-vs-v3.2-Release/
H A Djs-apidiff-global.md218 …ed|Class name: RelativeTimeFormat;<br>Method or attribute name: constructor();<br>Old version info…
308RelativeTimeFormat;<br>Method or attribute name: export class RelativeTimeFormat<br>Old version in…
309RelativeTimeFormat;<br>Method or attribute name: constructor(locale: string \| Array\<string>, opt…
310RelativeTimeFormat;<br>Method or attribute name: format(value: number, unit: string): string;<br>O…
311RelativeTimeFormat;<br>Method or attribute name: formatToParts(value: number, unit: string): Array…
312RelativeTimeFormat;<br>Method or attribute name: resolvedOptions(): RelativeTimeFormatResolvedOpti…
/ohos5.0/docs/en/release-notes/api-diff/v3.1-beta/
H A Djs-apidiff-v3.1-beta.md162 | Globalization - Intl| RelativeTimeFormat.constructor(); | Added| Added this constructor.|
163 | Globalization - Intl| RelativeTimeFormat.constructor(locale: string \| Array\<string>, options?: …
164 | Globalization - Intl| RelativeTimeFormat.format(value: number, unit: string): string; | Added| Ad…
165 | Globalization - Intl| RelativeTimeFormat.formatToParts(value: number, unit: string): Array\<objec…
166 | Globalization - Intl| RelativeTimeFormat.formatToParts(value: number, unit: string): Array\<objec…
/ohos5.0/base/global/i18n/interfaces/js/kits/src/
H A Dintl_addon.cpp490 relativetimefmt_ = std::make_unique<RelativeTimeFormat>(localeTags, map); in InitRelativeTimeFormatContext()