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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files 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, |
|
|
|
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) { |
|
|
|
|