Selaa lähdekoodia

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

Co-authored-by: “weilin <“784742294@qq.com>
wl19 3 vuotta sitten
vanhempi
commit
350c85accf
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      src/utils/dateUtil.ts

+ 2 - 2
src/utils/dateUtil.ts

@@ -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);
 }