Skip to content

Commit

Permalink
feat: allow formatDate and formatTime to take string type (#1369)
Browse files Browse the repository at this point in the history
JS have implicitly type conversion, 2019-07-13 can be read correctly.
This makes it easy to use when date is read from a JSON object.
  • Loading branch information
leoyli authored and longlho committed Jul 23, 2019
1 parent 65eef98 commit d110548
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export type MessageFormatPrimitiveValue =
| undefined;

export interface IntlFormatters {
formatDate(value: number | Date, opts: FormatDateOptions): string;
formatTime(value: number | Date, opts: FormatDateOptions): string;
formatDate(value: string | number | Date, opts: FormatDateOptions): string;
formatTime(value: string | number | Date, opts: FormatDateOptions): string;
formatRelativeTime(
value: number,
unit?: FormattableUnit,
Expand Down

0 comments on commit d110548

Please sign in to comment.