Skip to content

Commit

Permalink
fixed incorrect definition of locale in typescript
Browse files Browse the repository at this point in the history
the first parameter of locale is optional so that locale() can be called with no arguments to return the current locale.
I would have added a test case to prove this works, but everything is in javascript and I expect you would not appreciate adding typescript to the unit tests.
  • Loading branch information
Greg Veres committed Apr 15, 2020
1 parent 3188e15 commit 9dfcb07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ declare namespace dayjs {

export function extend<T = unknown>(plugin: PluginFunc<T>, option?: T): Dayjs

export function locale(preset: string | ILocale, object?: Partial<ILocale>, isLocal?: boolean): string
export function locale(preset?: string | ILocale, object?: Partial<ILocale>, isLocal?: boolean): string

export function isDayjs(d: any): d is Dayjs

Expand Down

0 comments on commit 9dfcb07

Please sign in to comment.