Skip to content

Commit

Permalink
Fix OptionType signature to accept format
Browse files Browse the repository at this point in the history
  • Loading branch information
ypresto committed Feb 22, 2019
1 parent 1051814 commit 0bb72c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions test/index.d.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ dayjs(730944000000)

dayjs(new Date(1993, 3, 1))

dayjs('05/02/69 1:02:03 PM -05:00', 'MM/DD/YY H:mm:ss A Z')

dayjs('05/02/69 1:02:03 PM -05:00', { format: 'MM/DD/YY H:mm:ss A Z' })

dayjs('1993-03-1', { locale: 'ja' })

dayjs().clone()

dayjs().isValid()
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ declare namespace dayjs {
/** @deprecated Renamed to DateType. */
export type ConfigType = DateType

export type OptionType = { locale: string }
export type OptionType = { locale?: string, format?: string } | string

type UnitTypeShort = 'd' | 'M' | 'y' | 'h' | 'm' | 's' | 'ms'
export type UnitType = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'quarter' | 'year' | 'date' | UnitTypeShort;
Expand Down

0 comments on commit 0bb72c6

Please sign in to comment.