Skip to content

Date.toLocaleDateString signature incorrect #4294

Description

@gwicksted

It is incorrectly defined as no arguments in both lib.d.ts as well as the most recent DefinitelyTyped date.format.d.ts

See spec

I believe it should be this:

toLocaleDateString(locales?: string[] | string, options?: Intl.DateTimeFormatOptions): string;

JavaScript example:

var date = new Date(Date.UTC(2015, 8, 12, 9, 41, 0));
console.log(date.toLocaleDateString(['en-US'], { month: "2-digit" }));
// will write "08" to the console

NOTE: I believe toLocaleTimeString has the same problem.

I am willing to submit a pull request -- I'm just not that familiar with writing jake tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions