API and Microservices Timestamp Project Problems

I am not sure why this part is failing:
Your project can handle dates that can be successfully parsed by new Date(date_string).

I believe i am passing a number to the new Date.

please can someone take a look for me. Thanks

Code below.

Your code so far

Link to the challenge:

Welcome there,

Why do you assume the date parameter either contains a - or is a number? Dates can come in many forms without that.

I suggest you take a look at the requests made in the network tab of the browser devtools to get an idea of what the tests are doing.

Hope this helps

I believe the tests need only be for ISO-8601 or a number ie. a number in ms. All test cases are passing apart from:

Your project can handle dates that can be successfully parsed by new Date(date_string) .

I just cant see where it is going wrong because if i pass this the date_string directly this passes even though the output for the previous test is wrong. if i pass new Date(Number(date_string)) i get the desired output but the for mentioned test fails.

Have you managed to fix this, because your link now passes the tests for me?

All sorted now. You were right, i added a test for not only “-” seperated values and it passed. Thanks for your help :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.