Browse Source

fix/invaild dateFormat (#1871)

Co-authored-by: Felix Hoi <felixhoi@ssm.gov.mo>
Felix Hoi 3 years ago
parent
commit
0634f2ca9e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/components/Table/src/hooks/useColumns.ts

+ 1 - 1
src/components/Table/src/hooks/useColumns.ts

@@ -298,7 +298,7 @@ export function formatCell(text: string, format: CellFormat, record: Recordable,
   try {
     // date type
     const DATE_FORMAT_PREFIX = 'date|';
-    if (isString(format) && format.startsWith(DATE_FORMAT_PREFIX)) {
+    if (isString(format) && format.startsWith(DATE_FORMAT_PREFIX) && text) {
       const dateFormat = format.replace(DATE_FORMAT_PREFIX, '');
 
       if (!dateFormat) {