Commit 2104d044 authored by Riri Novita's avatar Riri Novita

tanggal excel

parent 82b1f8fd
...@@ -435,7 +435,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -435,7 +435,7 @@ export default class ListOfCreditFacilities extends Component {
fileHandler = (event) => { fileHandler = (event) => {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp) console.log(resp)
if (err) { if (err) {
console.log(err); console.log(err);
} }
...@@ -446,9 +446,15 @@ export default class ListOfCreditFacilities extends Component { ...@@ -446,9 +446,15 @@ export default class ListOfCreditFacilities extends Component {
let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/; let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/;
isi.map((i, index) => { isi.map((i, index) => {
if (i.length > 0) { if (i.length > 0) {
let excelDate = i[5]
let excelBaseDate = new Date('1900-01-01');
let javascriptBaseDate = new Date('1970-01-01');
let daysBetween = excelDate - 1;
let javascriptDate = new Date(excelBaseDate.getTime() + (daysBetween * 24 * 60 * 60 * 1000));
let tgl = String(i[5]).split('-') let tgl = String(i[5]).split('-')
console.log(i[5]) console.log(i[5])
console.log(tgl) console.log(tgl)
console.log(javascriptDate);
payload.push({ payload.push({
"item_report_id": i[1], "item_report_id": i[1],
"borrower_comp_name": this.props.company.company_name, "borrower_comp_name": this.props.company.company_name,
...@@ -3295,7 +3301,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -3295,7 +3301,7 @@ export default class ListOfCreditFacilities extends Component {
placeholder="" placeholder=""
disabled={true} disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")), 2)) : (Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")) == 0 ? "0.0" : Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")) )} value={this.props.defaultCurrency.id == 1 ? (fixNumber(Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")), 2)) : (Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")) == 0 ? "0.0" : Number(handleTableRatio(tableMeta.rowData[32], tableMeta, 32, "EBITDA to Interest - YTD")))}
/> />
} }
/> />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment