So my application is wrote in java and Spring and I need to pass a hash map with [data,value] from backend to frontend , using THYMELEAF, so I can render them into a graph. These are my lines in my controller
model.addAttribute("hashValues",resultHash.values());
model.addAttribute("hashTime",resultHash.keySet());
When trying to access them in javascript, the hashValues seem to be right, but the time list has a problem. When using console.log to print hashTime my console says something like [1996,1997,1997] when in reality my dates are [2021-10-15, 2021-10-14, 2021-10-13]. I will add some images for a better understanding.
This is how I get the lists from the model.
var time = [[${hashTime}]]
var values = [[${hashValues}]]
console.log(time)
console.log(values)

I've tried using JSON.parse but I have the same problem. Any help is appreciated cause I've been working with JavaScript for some time and I never encountered this type of problem before.