I am constructing an array using .map, the output is as follows:
renderDataLabels = (labelArray) => {
const res = Object.values(this.state.totalCalls);
labelArray = res.map(label => {
return label.date
})
console.log(labelArray);
return labelArray
}
/// Output: ///
0: "2020-07-11"
1: "2020-07-12"
2: "2020-07-13"
3: "2020-07-14"
4: "2020-07-15"
5: "2020-07-16"
6: "2020-07-17"
7: "2020-07-18"
8: "2020-07-19"
9: "2020-07-20"
10: "2020-07-21"
How can I format the dates before returning the array so that they are formatted as Jul, XX 2020?