Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6bc781b0
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6bc781b0
编写于
8月 25, 2021
作者:
O
openharmony_ci
提交者:
Gitee
8月 25, 2021
浏览文件
操作
浏览文件
下载
差异文件
!471 modify testcases on 20210825
Merge pull request !471 from 杨清/0720
上级
5ea4db37
a8593cb0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
203 addition
and
80 deletion
+203
-80
global/i18n_standard/intljs/project/entry/src/main/js/test/I18n.test.js
...andard/intljs/project/entry/src/main/js/test/I18n.test.js
+203
-80
未找到文件。
global/i18n_standard/intljs/project/entry/src/main/js/test/I18n.test.js
浏览文件 @
6bc781b0
...
...
@@ -333,7 +333,7 @@ describe('intlTest', function () {
*/
it
(
'
locale_test_2300
'
,
0
,
function
()
{
var
locale
=
new
Intl
.
Locale
(
'
zh
'
);
console
.
log
(
"
locale_test_2300
"
+
locale
.
maximize
().
maximize
().
toString
());
console
.
log
(
"
locale_test_2300
"
+
locale
.
maximize
().
toString
());
expect
(
locale
.
maximize
().
toString
()).
assertEqual
(
"
zh-Hans-CN
"
);
})
...
...
@@ -344,7 +344,7 @@ describe('intlTest', function () {
*/
it
(
'
locale_test_2301
'
,
0
,
function
()
{
var
locale
=
new
Intl
.
Locale
(
'
zh-CN
'
);
console
.
log
(
"
locale_test_2301
"
+
locale
.
maximize
().
maximize
().
toString
());
console
.
log
(
"
locale_test_2301
"
+
locale
.
maximize
().
toString
());
expect
(
locale
.
maximize
().
toString
()).
assertEqual
(
"
zh-Hans-CN
"
);
})
...
...
@@ -355,7 +355,7 @@ describe('intlTest', function () {
*/
it
(
'
locale_test_2302
'
,
0
,
function
()
{
var
locale
=
new
Intl
.
Locale
(
'
zh-Hans-CN
'
);
console
.
log
(
"
locale_test_2302
"
+
locale
.
maximize
().
maximize
().
toString
());
console
.
log
(
"
locale_test_2302
"
+
locale
.
maximize
().
toString
());
expect
(
locale
.
maximize
().
toString
()).
assertEqual
(
"
zh-Hans-CN
"
);
})
...
...
@@ -377,7 +377,7 @@ describe('intlTest', function () {
*/
it
(
'
locale_test_2304
'
,
0
,
function
()
{
var
locale
=
new
Intl
.
Locale
(
'
zh
'
,
{
calendar
:
'
gregory
'
,
collation
:
'
compact
'
});
console
.
log
(
"
locale_test_2304
"
+
locale
.
maximize
().
maximize
().
toString
());
console
.
log
(
"
locale_test_2304
"
+
locale
.
maximize
().
toString
());
expect
(
locale
.
maximize
().
toString
()).
assertEqual
(
"
zh-Hans-CN-u-ca-gregory-co-compact
"
);
})
...
...
@@ -388,7 +388,7 @@ describe('intlTest', function () {
*/
it
(
'
locale_test_2305
'
,
0
,
function
()
{
var
locale
=
new
Intl
.
Locale
(
'
zh-CN
'
,
{
calendar
:
'
gregory
'
,
collation
:
'
compact
'
});
console
.
log
(
"
locale_test_2305
"
+
locale
.
maximize
().
maximize
().
toString
());
console
.
log
(
"
locale_test_2305
"
+
locale
.
maximize
().
toString
());
expect
(
locale
.
maximize
().
toString
()).
assertEqual
(
"
zh-Hans-CN-u-ca-gregory-co-compact
"
);
})
...
...
@@ -399,84 +399,219 @@ describe('intlTest', function () {
*/
it
(
'
locale_test_2306
'
,
0
,
function
()
{
var
locale
=
new
Intl
.
Locale
(
'
zh-Hans-CN
'
,
{
calendar
:
'
gregory
'
,
collation
:
'
compact
'
});
console
.
log
(
"
locale_test_2306
"
+
locale
.
maximize
().
maximize
().
toString
());
console
.
log
(
"
locale_test_2306
"
+
locale
.
maximize
().
toString
());
expect
(
locale
.
maximize
().
toString
()).
assertEqual
(
"
zh-Hans-CN-u-ca-gregory-co-compact
"
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
12
00
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_01
00
* @tc.name format the datetime with en-GB locale
* @tc.desc check the datetime is not null
*/
it
(
'
dateTimeFormat_test_0
01
'
,
0
,
function
()
{
it
(
'
dateTimeFormat_test_0
100
'
,
0
,
function
()
{
var
datefmt
=
new
Intl
.
DateTimeFormat
(
"
en-GB
"
);
expect
(
datefmt
!=
null
).
assertTrue
();
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
13
00
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_02
00
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it
(
'
formatDateTimeFormat_test_001
'
,
0
,
function
()
{
it
(
'
dateTimeFormat_test_0200
'
,
0
,
function
()
{
var
date
=
new
Date
(
2021
,
11
,
17
,
3
,
24
,
0
);
var
datefmt
=
new
Intl
.
DateTimeFormat
(
"
zh
"
);
console
.
log
(
"
dateTimeFormat_test_0200
"
+
datefmt
.
format
(
date
));
expect
(
datefmt
.
format
(
date
)).
assertEqual
(
'
2021/12/17
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_DATETIME_0300
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it
(
'
dateTimeFormat_test_0300
'
,
0
,
function
()
{
var
date
=
new
Date
(
2021
,
11
,
17
,
3
,
24
,
0
);
var
datefmt
=
new
Intl
.
DateTimeFormat
(
"
en
"
);
console
.
log
(
"
dateTimeFormat_test_0300
"
+
datefmt
.
format
(
date
));
expect
(
datefmt
.
format
(
date
)).
assertEqual
(
'
12/17/21
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_DATETIME_0310
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it
(
'
dateTimeFormat_test_0310
'
,
0
,
function
()
{
var
date
=
new
Date
(
2021
,
11
,
17
,
3
,
24
,
0
);
var
datefmt
=
new
Intl
.
DateTimeFormat
(
"
en-US
"
);
console
.
log
(
"
dateTimeFormat_test_0310
"
+
datefmt
.
format
(
date
));
expect
(
datefmt
.
format
(
date
)).
assertEqual
(
'
12/17/21
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_DATETIME_0320
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
it
(
'
dateTimeFormat_test_0320
'
,
0
,
function
()
{
var
date
=
new
Date
(
2021
,
11
,
17
,
3
,
24
,
0
);
var
datefmt
=
new
Intl
.
DateTimeFormat
(
"
en-GB
"
);
console
.
log
(
"
dateTimeFormat_test_0320
"
+
datefmt
.
format
(
date
));
expect
(
datefmt
.
format
(
date
)).
assertEqual
(
'
17/12/2021
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_1400
* @tc.number SUB_GLOBAL_I18N_JS_DATETIME_0400
* @tc.name format the date with en-GB locale
* @tc.desc check the date
*/
// it('dateTimeFormat_test_0400', 0, function () {
// var date = new Date(2021, 11, 17, 3, 24, 0);
// var datefmt = new Intl.DateTimeFormat("aa");
// console.log("dateTimeFormat_test_0400 " + datefmt.format(date));
// expect(datefmt.format(date)).assertEqual('2021/12/17');
// })
/* *
* @tc.number SUB_GLOBAL_I18N_JS_DATETIME_0500
* @tc.name format the hour
* @tc.desc check the hour
*/
it
(
'
dateTimeFormat_test_0500
'
,
0
,
function
()
{
var
date
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
option
=
{
dateStyle
:
'
full
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
([
'
ban
'
,
'
zh
'
],
option
);
console
.
log
(
"
dateTimeFormat_test_0500
"
+
datefmt
.
format
(
date
));
expect
(
datefmt
.
format
(
date
)).
assertEqual
(
'
2020年12月20日星期日
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_DATETIME_0600
* @tc.name format the hour
* @tc.desc check the hour
*/
it
(
'
dateTimeFormat_test_0600
'
,
0
,
function
()
{
var
date
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
option
=
{
dateStyle
:
'
full
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
([
'
en
'
,
'
zh
'
],
option
);
console
.
log
(
"
dateTimeFormat_test_0600
"
+
datefmt
.
format
(
date
));
expect
(
datefmt
.
format
(
date
)).
assertEqual
(
'
Sunday, December 20, 2020
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_DATETIME_0700
* @tc.name format the hour
* @tc.desc check the hour
*/
it
(
'
dateTimeFormat_test_0700
'
,
0
,
function
()
{
var
date
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
option
=
{
dateStyle
:
'
full
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
([
'
en
'
,
'
ban
'
],
option
);
console
.
log
(
"
dateTimeFormat_test_0700
"
+
datefmt
.
format
(
date
));
expect
(
datefmt
.
format
(
date
)).
assertEqual
(
'
Sunday, December 20, 2020
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_DATETIME_0800
* @tc.name format the hour
* @tc.desc check the hour
*/
it
(
'
dateTimeFormat_test_0800
'
,
0
,
function
()
{
var
date
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
option
=
{
dateStyle
:
'
full
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
([
'
abc
'
,
'
ban
'
],
option
);
console
.
log
(
"
dateTimeFormat_test_0800
"
+
datefmt
.
format
(
date
));
expect
(
datefmt
.
format
(
date
)).
assertEqual
(
'
12/20/20, 2:23 PM
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_DATETIME_0900
* @tc.name format the date with full datestyle and mediu timestyle
* @tc.desc check the date with full datestyle and mediu timestyle
*/
it
(
'
formatDateTimeFormat_test_002
'
,
0
,
function
()
{
it
(
'
dateTimeFormat_test_0900
'
,
0
,
function
()
{
var
date
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
option
=
{
dateStyle
:
'
full
'
,
timeStyle
:
'
medium
'
};
var
option
=
{
dateStyle
:
'
full
'
,
timeStyle
:
'
full
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
zh-Hans-CN
'
,
option
);
console
.
log
(
"
dateTimeFormat_test_0900
"
+
datefmt
.
format
(
date
));
expect
(
datefmt
.
format
(
date
)).
assertEqual
(
'
2020年12月20日星期日 协调世界时 下午2:23:16
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_DATETIME_1000
* @tc.name format the date dateStyle
* @tc.desc check the dateStyle
*/
it
(
'
dateTimeFormat_test_1000
'
,
0
,
function
()
{
var
date
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
option
=
{
dateStyle
:
'
long
'
,
timeStyle
:
'
long
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
zh-CN
'
,
option
);
expect
(
datefmt
.
format
(
date
)).
assertEqual
(
'
2020年12月20日星期日 下午2:23:16
'
);
console
.
log
(
"
dateTimeFormat_test_1000
"
+
datefmt
.
resolvedOptions
().
dateStyle
);
expect
(
datefmt
.
resolvedOptions
().
dateStyle
).
assertEqual
(
'
long
'
);
expect
(
datefmt
.
format
(
date
)).
assertEqual
(
'
2020年12月20日 UTC 下午2:23:16
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
15
00
* @tc.name format the date
with daterang
e
* @tc.desc check the date
rang
e
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_11
00
* @tc.name format the date
dateStyl
e
* @tc.desc check the date
Styl
e
*/
it
(
'
formatDateTimeFormat_test_003
'
,
0
,
function
()
{
it
(
'
dateTimeFormat_test_1100
'
,
0
,
function
()
{
var
date
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
date2
=
new
Date
(
2020
,
11
,
21
,
14
,
23
,
16
);
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
en-GB
'
);
console
.
log
(
"
jessie 003
"
+
datefmt
.
formatRange
(
date
,
date2
));
expect
(
datefmt
.
formatRange
(
date
,
date2
)).
assertEqual
(
'
20/12/2020 – 21/12/2020
'
);
var
option
=
{
dateStyle
:
'
medium
'
,
timeStyle
:
'
medium
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
zh-CN
'
,
option
);
console
.
log
(
"
dateTimeFormat_test_1100
"
+
datefmt
.
resolvedOptions
().
dateStyle
);
expect
(
datefmt
.
resolvedOptions
().
dateStyle
).
assertEqual
(
'
medium
'
);
expect
(
datefmt
.
format
(
date
)).
assertEqual
(
'
2020年12月20日 下午2:23:16
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
16
00
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_12
00
* @tc.name format the date dateStyle
* @tc.desc check the dateStyle
*/
it
(
'
formatDateTimeFormat_test_004
'
,
0
,
function
()
{
var
option
=
{
dateStyle
:
'
full
'
,
timeStyle
:
'
medium
'
};
it
(
'
dateTimeFormat_test_1200
'
,
0
,
function
()
{
var
date
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
option
=
{
dateStyle
:
'
short
'
,
timeStyle
:
'
short
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
zh-CN
'
,
option
);
expect
(
datefmt
.
resolvedOptions
().
dateStyle
).
assertEqual
(
'
full
'
);
console
.
log
(
"
dateTimeFormat_test_1200
"
+
datefmt
.
resolvedOptions
().
dateStyle
);
expect
(
datefmt
.
resolvedOptions
().
dateStyle
).
assertEqual
(
'
short
'
);
expect
(
datefmt
.
format
(
date
)).
assertEqual
(
'
2020/12/20 下午2:23
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_DATETIME_1300
* @tc.name format the date with daterange
* @tc.desc check the daterange
*/
it
(
'
dateTimeFormat_test_1300
'
,
0
,
function
()
{
var
startdate
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
enddate
=
new
Date
(
2020
,
11
,
21
,
14
,
23
,
16
);
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
en-GB
'
);
console
.
log
(
"
dateTimeFormat_test_1300
"
+
datefmt
.
formatRange
(
startdate
,
enddate
));
expect
(
datefmt
.
formatRange
(
startdate
,
enddate
)).
assertEqual
(
'
20/12/2020 – 21/12/2020
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
17
00
* @tc.name format the date
timeStyl
e
* @tc.desc check the
timeStyl
e
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_14
00
* @tc.name format the date
with daterang
e
* @tc.desc check the
daterang
e
*/
it
(
'
formatDateTimeFormat_test_005
'
,
0
,
function
()
{
var
option
=
{
dateStyle
:
'
full
'
,
timeStyle
:
'
long
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
en-GB
'
,
option
);
expect
(
datefmt
.
resolvedOptions
().
timeStyle
).
assertEqual
(
'
long
'
);
it
(
'
dateTimeFormat_test_1400
'
,
0
,
function
()
{
var
startdate
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
enddate
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
en-GB
'
);
console
.
log
(
"
dateTimeFormat_test_1400
"
+
datefmt
.
formatRange
(
startdate
,
enddate
));
expect
(
datefmt
.
formatRange
(
startdate
,
enddate
)).
assertEqual
(
'
20/12/2020
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
18
00
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_15
00
* @tc.name format the year、month、day、weekday
* @tc.desc check the year、month、day、weekday
*/
it
(
'
formatDateTimeFormat_test_006
'
,
0
,
function
()
{
it
(
'
dateTimeFormat_test_1500
'
,
0
,
function
()
{
var
date
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
option
=
{
year
:
'
numeric
'
,
month
:
'
long
'
,
day
:
'
numeric
'
,
weekday
:
'
long
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
ja
'
,
option
);
...
...
@@ -485,25 +620,25 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
19
00
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_16
00
* @tc.name format the timerange with year、month、day、weekday
* @tc.desc check the timerange with year、month、day、weekday
*/
it
(
'
formatDateTimeFormat_test_007
'
,
0
,
function
()
{
var
date
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
date2
=
new
Date
(
2021
,
4
,
5
,
10
,
5
,
3
);
it
(
'
dateTimeFormat_test_1600
'
,
0
,
function
()
{
var
start
date
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
enddate
=
new
Date
(
2021
,
4
,
5
,
10
,
5
,
3
);
var
option
=
{
year
:
'
numeric
'
,
month
:
'
long
'
,
day
:
'
numeric
'
,
weekday
:
'
long
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
en
'
,
option
);
console
.
log
(
"
jessie 007
"
+
datefmt
.
formatRange
(
date
,
date2
));
expect
(
datefmt
.
formatRange
(
date
,
date2
)).
assertEqual
(
'
Sunday, December 20, 2020 – Wednesday, May 5, 2021
'
);
console
.
log
(
"
jessie 007
"
+
datefmt
.
formatRange
(
startdate
,
enddate
));
expect
(
datefmt
.
formatRange
(
startdate
,
enddate
)).
assertEqual
(
'
Sunday, December 20, 2020 – Wednesday, May 5, 2021
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
20
00
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_17
00
* @tc.name format the hour&minute&second
* @tc.desc check the hour&minute&second
*/
it
(
'
formatDateTimeFormat_test_008
'
,
0
,
function
()
{
it
(
'
dateTimeFormat_test_1700
'
,
0
,
function
()
{
var
date
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
option
=
{
year
:
'
numeric
'
,
month
:
'
long
'
,
day
:
'
numeric
'
,
hour
:
'
numeric
'
,
minute
:
'
2-digit
'
,
second
:
'
numeric
'
,
weekday
:
'
long
'
,
era
:
'
short
'
};
...
...
@@ -513,11 +648,11 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
21
00
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_18
00
* @tc.name format the timeZone
* @tc.desc check the timeZone
*/
it
(
'
formatDateTimeFormat_test_009
'
,
0
,
function
()
{
it
(
'
dateTimeFormat_test_1800
'
,
0
,
function
()
{
var
date
=
new
Date
(
2020
,
3
,
14
,
15
,
5
,
3
);
var
option
=
{
timeZone
:
'
America/Los_Angeles
'
,
timeZoneName
:
'
long
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
zh-CN-u-hc-h12
'
,
option
);
...
...
@@ -526,33 +661,33 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
22
00
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_19
00
* @tc.name format the America/Los_Angeles timeZone
* @tc.desc check the America/Los_Angeles timeZone
*/
it
(
'
formatDateTimeFormat_test_01
0
'
,
0
,
function
()
{
it
(
'
dateTimeFormat_test_190
0
'
,
0
,
function
()
{
var
option
=
{
timeZone
:
'
America/Los_Angeles
'
,
timeZoneName
:
'
long
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
zh-CN-u-hc-h12
'
,
option
);
expect
(
datefmt
.
resolvedOptions
().
timeZone
).
assertEqual
(
'
America/Los_Angeles
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
23
00
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_20
00
* @tc.name format the America/Los_Angeles timeZoneName
* @tc.desc check the America/Los_Angeles timeZoneName
*/
it
(
'
formatDateTimeFormat_test_011
'
,
0
,
function
()
{
it
(
'
dateTimeFormat_test_2000
'
,
0
,
function
()
{
var
option
=
{
timeZone
:
'
America/Los_Angeles
'
,
timeZoneName
:
'
long
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
zh-CN-u-hc-h12
'
,
option
);
expect
(
datefmt
.
resolvedOptions
().
timeZoneName
).
assertEqual
(
'
long
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
24
00
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_21
00
* @tc.name format the year
* @tc.desc check the year
*/
it
(
'
formatDateTimeFormat_test_012
'
,
0
,
function
()
{
it
(
'
dateTimeFormat_test_2100
'
,
0
,
function
()
{
var
option
=
{
year
:
'
numeric
'
,
month
:
'
long
'
,
day
:
'
numeric
'
,
hour
:
'
numeric
'
,
minute
:
'
2-digit
'
,
second
:
'
numeric
'
,
weekday
:
'
long
'
,
era
:
'
short
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
zh-CN-u-hc-h12
'
,
option
);
...
...
@@ -560,11 +695,11 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
25
00
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_22
00
* @tc.name format the weekday
* @tc.desc check the weekday
*/
it
(
'
formatDateTimeFormat_test_013
'
,
0
,
function
()
{
it
(
'
dateTimeFormat_test_2200
'
,
0
,
function
()
{
var
option
=
{
year
:
'
numeric
'
,
month
:
'
long
'
,
day
:
'
numeric
'
,
hour
:
'
numeric
'
,
minute
:
'
2-digit
'
,
second
:
'
numeric
'
,
weekday
:
'
long
'
,
era
:
'
short
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
zh-CN-u-hc-h12
'
,
option
);
...
...
@@ -572,11 +707,11 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
26
00
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_23
00
* @tc.name format the hour
* @tc.desc check the hour
*/
it
(
'
formatDateTimeFormat_test_014
'
,
0
,
function
()
{
it
(
'
dateTimeFormat_test_2300
'
,
0
,
function
()
{
var
option
=
{
year
:
'
numeric
'
,
month
:
'
long
'
,
day
:
'
numeric
'
,
hour
:
'
numeric
'
,
minute
:
'
2-digit
'
,
second
:
'
numeric
'
,
weekday
:
'
long
'
,
era
:
'
short
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
zh-CN-u-hc-h12
'
,
option
);
...
...
@@ -584,11 +719,11 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_
27
00
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_24
00
* @tc.name format the hour
* @tc.desc check the hour
*/
it
(
'
formatDateTimeFormat_test_015
'
,
0
,
function
()
{
it
(
'
dateTimeFormat_test_2400
'
,
0
,
function
()
{
var
date
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
option
=
{
dateStyle
:
'
full
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
(
'
fr-Latn-FR-u-nu-mong
'
,
option
);
...
...
@@ -596,23 +731,11 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_2701
* @tc.name format the hour
* @tc.desc check the hour
*/
it
(
'
formatDateTimeFormat_test_016
'
,
0
,
function
()
{
var
date
=
new
Date
(
2020
,
11
,
20
,
14
,
23
,
16
);
var
option
=
{
dateStyle
:
'
full
'
};
var
datefmt
=
new
Intl
.
DateTimeFormat
([
'
ban
'
,
'
zh
'
],
option
);
expect
(
datefmt
.
format
(
date
)).
assertEqual
(
'
2020年12月20日星期日
'
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_2702
* @tc.number SUB_GLOBAL_I18N_JS_DATETIME_2500
* @tc.name format the hour
* @tc.desc check the hour
*/
it
(
'
formatDateTimeFormat_test_017
'
,
0
,
function
()
{
it
(
'
dateTimeFormat_test_2500
'
,
0
,
function
()
{
var
option
=
{
year
:
'
numeric
'
,
month
:
'
long
'
,
day
:
'
numeric
'
,
hour
:
'
numeric
'
,
minute
:
'
2-digit
'
,
second
:
'
numeric
'
,
weekday
:
'
long
'
,
era
:
'
short
'
,
hourCycle
:
'
h24
'
,
numberingSystem
:
'
arab
'
,
hour12
:
true
,
dayPeriod
:
'
short
'
,
...
...
@@ -633,7 +756,7 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_2800
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_
2800
* @tc.name format the number in en-GB
* @tc.desc check the number in en-GB
*/
...
...
@@ -644,7 +767,7 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_2900
* @tc.number SUB_GLOBAL_I18N_JS_
DATETIME_
2900
* @tc.name format the number with scientific
* @tc.desc check the number with scientific
*/
...
...
@@ -657,7 +780,7 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_3000
* @tc.number SUB_GLOBAL_I18N_JS_
NUMBER_
3000
* @tc.name format the number with currency
* @tc.desc check the number with currency
*/
...
...
@@ -675,7 +798,7 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_3001
* @tc.number SUB_GLOBAL_I18N_JS_
NUMBER_
3001
* @tc.name format the number with currency
* @tc.desc check the number with currency
*/
...
...
@@ -696,7 +819,7 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_3100
* @tc.number SUB_GLOBAL_I18N_JS_
NUMBER_
3100
* @tc.name format the number with unit
* @tc.desc check the number with unit
*/
...
...
@@ -711,7 +834,7 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_3200
* @tc.number SUB_GLOBAL_I18N_JS_
NUMBER_
3200
* @tc.name format the number with unit
* @tc.desc check the number with unit
*/
...
...
@@ -723,7 +846,7 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_3300
* @tc.number SUB_GLOBAL_I18N_JS_
NUMBER_
3300
* @tc.name format the number with numberingSystem
* @tc.desc check the number with numberingSystem
*/
...
...
@@ -735,7 +858,7 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_3400
* @tc.number SUB_GLOBAL_I18N_JS_
NUMBER_
3400
* @tc.name format the number with style
* @tc.desc check the number with style
*/
...
...
@@ -753,7 +876,7 @@ describe('intlTest', function () {
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_3500
* @tc.number SUB_GLOBAL_I18N_JS_
NUMBER_
3500
* @tc.name format the number with style
* @tc.desc check the number with style
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录