Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add lacking documentation for Date constructor interface

See original GitHub issue

lib Update Request

Configuration Check

My compilation target is ES5 and my lib is the default.

Missing / Incorrect Definition

None - this is just improving documentation (jsdocs).

Sample Code

None - this is just improving documentation (jsdocs).

Documentation Link

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

MartinJohnscommented, Aug 19, 2021

You can’t call the constructor anymore with a variable typed as number | string:

const value = 0 as number | string;
new Date(value)
bruno-brantcommented, Aug 20, 2021

And while we’re at it, is there a guide for this kind of documentation? I wouldn’t mind making those improvements and if there’s some guidance I’d be happy to follow it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Date() constructor - JavaScript - MDN Web Docs - Mozilla
Note: Date() can be called with or without new , but with different effects. See Return value. Parameters. There are five basic forms...
Read more >
Handbook - Interfaces - TypeScript
One of TypeScript's core principles is that type checking focuses on the shape that values have. This is sometimes called “duck typing” or...
Read more >
typescript - How does interfaces with construct signatures work?
Construct signatures in interfaces are not implementable in classes; they're only for defining existing JS APIs that define a 'new'-able ...
Read more >
How to Write Doc Comments for the Javadoc Tool - Oracle
This document describes the style guide, tag and image conventions we use in ... For example, if a package, class, interface or member...
Read more >
Typescript Date Object - Javatpoint
If we create a date without any argument passed to its constructor, by default, it contains the date and time of the user's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found