Skip to content

refactor: use union type in DateConstructor #21757

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

Merged
merged 2 commits into from
Feb 8, 2018

Conversation

alan-agius4
Copy link
Contributor

@alan-agius4 alan-agius4 commented Feb 8, 2018

Add support for union types in DateConstructor

This will add support for something like the below;
let date; string | number; const date = new Date(x);

Fixes #21758
Fixes #20900

@alan-agius4 alan-agius4 changed the title feat: use union type in DateConstructor refactor: use union type in DateConstructor Feb 8, 2018
Add support for union types in `DateConstructor`

This will add support for something like the below;
`
let date; string | number;
const date = new Date(x);
`

Closes: microsoft#21758
@mhegazy
Copy link
Contributor

mhegazy commented Feb 8, 2018

We need another overload as well in src\lib\es2015.core.d.ts to handle number | string | Date, see #20900 (comment) for more context.

@alan-agius4
Copy link
Contributor Author

Pushed an update

@mhegazy mhegazy merged commit 7b9ceb8 into microsoft:master Feb 8, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Feb 8, 2018

thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants