|
|
@ -55,10 +55,8 @@ const columnToIndexs = { |
|
|
|
no: 2, |
|
|
|
no: 2, |
|
|
|
name: 3, |
|
|
|
name: 3, |
|
|
|
weight: 4, |
|
|
|
weight: 4, |
|
|
|
start_date: 5, |
|
|
|
nik: 5, |
|
|
|
end_date: 6, |
|
|
|
duration: 6 |
|
|
|
nik: 7, |
|
|
|
|
|
|
|
duration: 8 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const ExcelDateToJSDate = (date) => { |
|
|
|
const ExcelDateToJSDate = (date) => { |
|
|
@ -181,19 +179,6 @@ const ImportActivity = ({ params }) => { |
|
|
|
columnData = columnData.trim().replace(/ /g, '').replace(/<[^\/>][^>]*><\/[^>]+>/g, "") |
|
|
|
columnData = columnData.trim().replace(/ /g, '').replace(/<[^\/>][^>]*><\/[^>]+>/g, "") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// convert excel's DATEVALUE
|
|
|
|
|
|
|
|
if(["start_date"].includes(prop)){ |
|
|
|
|
|
|
|
if (columnData) { |
|
|
|
|
|
|
|
columnData = ExcelDateToJSDate(columnData) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(["end_date"].includes(prop)){ |
|
|
|
|
|
|
|
if (columnData) { |
|
|
|
|
|
|
|
columnData = ExcelDateToJSDateEndDay(columnData) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(["nik"].includes(prop)){ |
|
|
|
if(["nik"].includes(prop)){ |
|
|
|
if(columnData){ |
|
|
|
if(columnData){ |
|
|
|
let index = dataUserToProject.findIndex((x) => columnData == x.join_first_ktp_number);
|
|
|
|
let index = dataUserToProject.findIndex((x) => columnData == x.join_first_ktp_number);
|
|
|
@ -300,23 +285,6 @@ const ImportActivity = ({ params }) => { |
|
|
|
width: '10%', |
|
|
|
width: '10%', |
|
|
|
align: 'center', |
|
|
|
align: 'center', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
|
|
|
|
title: 'Start Date', |
|
|
|
|
|
|
|
dataIndex: 'start_date', |
|
|
|
|
|
|
|
key: 'start_date', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: 'Finish Date', |
|
|
|
|
|
|
|
dataIndex: 'end_date', |
|
|
|
|
|
|
|
key: 'end_date', |
|
|
|
|
|
|
|
render: (text, record) => { |
|
|
|
|
|
|
|
if(text){ |
|
|
|
|
|
|
|
return <span>{text.substring(0,8)}</span> |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return <span></span> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
title: 'Duration', |
|
|
|
title: 'Duration', |
|
|
|
dataIndex: 'duration', |
|
|
|
dataIndex: 'duration', |
|
|
|