Browse Source

fix/invaild dateFormat (#1871)

Co-authored-by: Felix Hoi <felixhoi@ssm.gov.mo>
pull/1880/head
Felix Hoi 4 years ago
committed by GitHub
parent
commit
0634f2ca9e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/components/Table/src/hooks/useColumns.ts

2
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) {

Loading…
Cancel
Save