Commit 0634f2ca9e2705ca8743fdb1e29c617d1370844a
Committed by
GitHub
1 parent
d09e998a
fix/invaild dateFormat (#1871)
Co-authored-by: Felix Hoi <felixhoi@ssm.gov.mo>
Showing
1 changed file
with
1 additions
and
1 deletions
src/components/Table/src/hooks/useColumns.ts
... | ... | @@ -298,7 +298,7 @@ export function formatCell(text: string, format: CellFormat, record: Recordable, |
298 | 298 | try { |
299 | 299 | // date type |
300 | 300 | const DATE_FORMAT_PREFIX = 'date|'; |
301 | - if (isString(format) && format.startsWith(DATE_FORMAT_PREFIX)) { | |
301 | + if (isString(format) && format.startsWith(DATE_FORMAT_PREFIX) && text) { | |
302 | 302 | const dateFormat = format.replace(DATE_FORMAT_PREFIX, ''); |
303 | 303 | |
304 | 304 | if (!dateFormat) { | ... | ... |