Excel sheet to json date issue: dd/mm/yyyy changed to mm/dd/yyyy
Hi, In my excel file date format is dd/mm/yyyy but FileReader object is returning mm/dd/yyyy. I tried all fixes provided by you in Issue ID: #703 but did not work. I feel there is an issue with File reader. Here is my code snippet:
var cfb = XLSX.read(binary, { type: 'binary', cellDates: true, dateNF: 'dd/mm/yyyy' }); var sCSV = ''; var sCSVData = ''; if (cfb.SheetNames.length > 1) { $scope.sheetExcess = true; } cfb.SheetNames.forEach(function (sheetName) { sCSV = XLSX.utils.sheet_to_row_object_array(cfb.Sheets[sheetName], {raw: false}); sCSVData = XLSX.utils.sheet_to_json(cfb.Sheets[sheetName], { header: 1 }); var xlData = sCSV;
Let me know if you see anything missing in my code.
XLSX.utils.json_to_sheet(output, { dateNF: "YYYY-MM-DD HH:mm:ss" });
you can change it to dateNf: "DD-MM-YYYY";
This seems to be same issue as #1005