Problem with Bar Chart: tootip data-date property

My project seems to pass all test but only sometimes. The problem is with the tool-tip we have to create. The user story we have to pass is to have the tooltip have have a data-date property. I created one but for whatever reason it re-formats it and it takes away the zero in-front of the single digit. I don’t know why the re-formatting happens but i have taken the liberty of looking at the code provided in the example and it seems to work very similarly.

can anyone help is this a bug? should I report a bug?

Here is my codepen.

Hi there I was having the exact same problem and couldnt get d3 to assign an attribtue without it removing the 0s. I believe the problem lies somewhere in the d3 method of .attr which would reformat the date no matter what. In my case it seems to work if I pass the attribute using plain js instead of d3. I added this function to the end of my d3 .on(“mouseover”,…) and its now passing the tests:

function pleaseMakeTestsPass(data){
                          document.querySelector("#tooltip").setAttribute("data-date", data)

Simply pass the relevant data (probably d[0] or something) as the arguments and it should assign it correctly.

I hope this can get your tests passing for now!

I was going to link my codepen but it seems that its not possible for new accounts.