Skip to content

toLocaleDateString does not handle zh-CN properly #42030

Closed as not planned
Closed as not planned
@FredrikL

Description

@FredrikL

Version

16.14

Platform

MacOS 12.2.1 & Github Actions linux based runners

Subsystem

icu

What steps will reproduce the bug?

The following script can be used to reproduce

const dateWithTimeOptions = Object.freeze({
  year: 'numeric',
  month: '2-digit',
  day: '2-digit',
  hour: 'numeric',
  minute: 'numeric',
});

const localTime = Date.now();
const str = new Date(localTime).toLocaleDateString('zh-CN', dateWithTimeOptions);
console.log(str);

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

Output with 16.13 (expected)
2022/02/17 下午3:42

What do you see instead?

Output with 16.14
2022/02/17 15:42

Additional information

No response

Metadata

Metadata

Assignees

Labels

i18n-apiIssues and PRs related to the i18n implementation.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions