Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add DateStyle and TimeStyle to DateTimeFormatOptions #44632

Closed
nstringham opened this issue Jun 17, 2021 · 1 comment
Closed

add DateStyle and TimeStyle to DateTimeFormatOptions #44632

nstringham opened this issue Jun 17, 2021 · 1 comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this
Milestone

Comments

@nstringham
Copy link

nstringham commented Jun 17, 2021

lib Update Request

Configuration Check

My compilation target is es2017 and my lib is ["dom"].

Missing / Incorrect Definition

DateTimeFormatOptions.DateStyle
DateTimeFormatOptions.TimeStyle

Sample Code

const date = new Date();
date.toLocaleString(undefined, { dateStyle: "long", timeStyle: "short" });

Documentation Link

TC39 spec: https://tc39.es/ecma402/#sec-intl-datetimeformat-constructor

MDN docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#parameters

Note:

this is a duplicate of #38266 but formated as a lib Update Request

this is not a duplicate of #35865

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this labels Jun 21, 2021
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jun 21, 2021
@nstringham
Copy link
Author

changing target to es2020 fixes this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

2 participants