/ohos5.0/base/global/i18n/frameworks/intl/src/ |
H A D | relative_time_format.cpp | 24 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 D | number_format.cpp | 147 relativeTimeFormat = std::make_unique<RelativeTimeFormat>(locales, in CreateRelativeTimeFormat()
|
/ohos5.0/docs/zh-cn/application-dev/internationalization/ |
H A D | i18n-time-date.md | 142 格式化相对时间将表示时间日期的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 D | i18n-time-date.md | 142 …./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 D | relative_time_format.h | 48 class RelativeTimeFormat { 50 …RelativeTimeFormat(const std::vector<std::string> &localeTag, std::map<std::string, std::string> &… 51 virtual ~RelativeTimeFormat();
|
H A D | number_format.h | 89 std::unique_ptr<RelativeTimeFormat> relativeTimeFormat = nullptr;
|
/ohos5.0/docs/zh-cn/application-dev/reference/apis-localization-kit/ |
H A D | js-apis-intl.md | 761 ## 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 D | js-apidiff-global.md | 17 | 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 D | js-apidiff-global.md | 17 | 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 D | intl_test.cpp | 1002 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 D | intl_test_extent.cpp | 658 RelativeTimeFormat *formatter = new RelativeTimeFormat(locales, options);
|
/ohos5.0/docs/en/application-dev/reference/apis-localization-kit/ |
H A D | js-apis-intl.md | 761 ## 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 D | relativetimeformat_fuzzer.cpp | 36 RelativeTimeFormat formatter(localeTags, options); in DoSomethingInterestingWithMyAPI()
|
/ohos5.0/docs/zh-cn/release-notes/api-diff/v4.0-Release to v3.2-Release/ |
H A D | js-apidiff-global.md | 218 |跨平台能力有变化|类名: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 D | js-apidiff-v3.1-beta.md | 162 | 全球化-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 D | intl_addon.h | 124 std::unique_ptr<RelativeTimeFormat> relativetimefmt_ = nullptr;
|
/ohos5.0/docs/en/release-notes/api-diff/v4.0-Release-vs-v3.2-Release/ |
H A D | js-apidiff-global.md | 218 …ed|Class name: RelativeTimeFormat;<br>Method or attribute name: constructor();<br>Old version info… 308 …RelativeTimeFormat;<br>Method or attribute name: export class RelativeTimeFormat<br>Old version in… 309 …RelativeTimeFormat;<br>Method or attribute name: constructor(locale: string \| Array\<string>, opt… 310 …RelativeTimeFormat;<br>Method or attribute name: format(value: number, unit: string): string;<br>O… 311 …RelativeTimeFormat;<br>Method or attribute name: formatToParts(value: number, unit: string): Array… 312 …RelativeTimeFormat;<br>Method or attribute name: resolvedOptions(): RelativeTimeFormatResolvedOpti…
|
/ohos5.0/docs/en/release-notes/api-diff/v3.1-beta/ |
H A D | js-apidiff-v3.1-beta.md | 162 | 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 D | intl_addon.cpp | 490 relativetimefmt_ = std::make_unique<RelativeTimeFormat>(localeTags, map); in InitRelativeTimeFormatContext()
|