未验证 提交 350c85ac 编写于 作者: W wl19 提交者: GitHub

fix(utils): The date function gets a non-date when the parameter is null (#954)

Co-authored-by: N“weilin <“784742294@qq.com>
上级 202aa42b
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册