从角度7的excel文件中获取数据后,我得到了无效的日期格式。
Upload() {
let fileReader = new FileReader();
fileReader.onload = (e) => {
this.arrayBuffer = fileReader.result;
var data = new Uint8Array(this.arrayBuffer);
var arr = new Array();
for (var i = 0; i != data.length; ++i)
arr[i] = String.fromCharCode(data[i]);
var bstr = arr.join("");
var workbook = XLSX.read(bstr, { type: "binary" });
var first_sheet_name = workbook.SheetNames[0];
var worksheet = workbook.Sheets[first_sheet_name];
const excelData = XLSX.utils.sheet_to_json(worksheet, { raw: true });
}
fileReader.readAsArrayBuffer(this.file);
}
我得到一个像43557
这样的日期,但是在我的excel文件中,日期格式是01/02/2019
并且
我想显示日期,例如01/02/2019