Home > Mobile >  JAVASCRIPT reading value from excel sheet displas a diffrent value
JAVASCRIPT reading value from excel sheet displas a diffrent value

Time:11-19

currently, I am working on a function that is needed to import all the excel data into json objects on a website, therefore I have used the XLSX.utils.sheet_to_json utility on JS which brings me all the data to JSON on the web page. but few data are invalid which are not the same as on the excel sheet specifically date formats.

on the read method what I was following is below

  var workbook = XLSX.read(data, {
        type: "binary", 
  });

do I need to add anything else to get the date data correctly?

CodePudding user response:

there are a few options you have to mention in order to get the data correctly on date format

let readData = XLSX.read(data, {
  type: "binary",
  cellDates: true,
  dateNF: "mm/dd/yyyy;@",
});


  • Related