I am using chart.js to display "price" data over the past 30 days. I am using a price API to do so. However the .time parameter returns the time as a UNIX timestamp. I would like the time to be displayed as a readable date.
To get the time and prices:
const data = json.Data.Data
const times = data.map(obj => obj.time)
const prices = data.map(obj => obj.high)
return {
times,
prices
}
My chart.js labels:
labels: times,
Is there a way to return this data as a full date instead of a timestamp ?