Skip to content

Commit

Permalink
fix(utils): The date function gets a non-date when the parameter is n…
Browse files Browse the repository at this point in the history
…ull (#954)

Co-authored-by: “weilin <“[email protected]>
  • Loading branch information
wl19 and “weilin authored Jul 22, 2021
1 parent 202aa42 commit 350c85a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/dateUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm';
const DATE_FORMAT = 'YYYY-MM-DD ';

export function formatToDateTime(
date: moment.MomentInput = null,
date: moment.MomentInput = undefined,
format = DATE_TIME_FORMAT
): string {
return moment(date).format(format);
}

export function formatToDate(date: moment.MomentInput = null, format = DATE_FORMAT): string {
export function formatToDate(date: moment.MomentInput = undefined, format = DATE_FORMAT): string {
return moment(date).format(format);
}

Expand Down

0 comments on commit 350c85a

Please sign in to comment.