'Javascript to export html table to Excel with change in column's having timeStamp to human readable Date and time

My problem is that in my database all date column is stored in timestamp so during displaying data on the table we convert this into human-readable .So I want to do the same thing during export.

Below picture is my export data

the red colour portion is timestamp value which is stored in a database so during export I want this as human-readable date and time.

This is my code

      export const onExport = (exportParams) => {
      let endpoint = exportParams.endpoint;
      if(store.state.project && store.state.project.id){
      endpoint += "&projectId=" + store.state.project.id;
    }
    window.location =
        store.state.api.url.replace("/v2.1", "") +
        "/grid/data/export?endpoint=" +
        encodeURIComponent(endpoint) +
        "&columns=" +
        encodeURIComponent(JSON.stringify(exportParams.columns)) +
        "&export-format=" +
        exportParams["export-format"] +
        "&name=" +
        exportParams.name +
        "&token=" +
        store.state.api.token;
      store.state.project.id : '';
      }; 

I go through several questions on StackOverflow but I did not find any solution

I visited. Javascript to export html table to Excel but I did not get my answer

In the database this column is stored as timestamp

The above picture is of stored value in the database.

So my goal is to get this column as human-readable in the export results. Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source