fix/invaild dateFormat (#1871)

Co-authored-by: Felix Hoi <felixhoi@ssm.gov.mo>
This commit is contained in:
Felix Hoi 2022-05-04 15:11:05 +08:00 committed by GitHub
parent d09e998ae7
commit 0634f2ca9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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