From c10ee5f1651ef552be0abf7d3cb4eb9210b86340 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Fri, 19 May 2023 10:35:34 +0700 Subject: [PATCH] Handling empty data import --- .../SimproV2/CreatedProyek/ImportActivity/index.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/ImportActivity/index.js b/src/views/SimproV2/CreatedProyek/ImportActivity/index.js index bb37abb..1761db4 100644 --- a/src/views/SimproV2/CreatedProyek/ImportActivity/index.js +++ b/src/views/SimproV2/CreatedProyek/ImportActivity/index.js @@ -141,11 +141,15 @@ const ImportActivity = ({ params }) => { // convert excel's DATEVALUE if(["start_date"].includes(prop)){ - columnData = ExcelDateToJSDate(columnData) + if (columnData) { + columnData = ExcelDateToJSDate(columnData) + } } if(["end_date"].includes(prop)){ - columnData = ExcelDateToJSDateEndDay(columnData) + if (columnData) { + columnData = ExcelDateToJSDateEndDay(columnData) + } } if(prop == 'weight'){ @@ -253,7 +257,11 @@ const ImportActivity = ({ params }) => { dataIndex: 'end_date', key: 'end_date', render: (text, record) => { - return {text.substring(0,8)} + if(text){ + return {text.substring(0,8)} + } else { + return + } } }, {