I still need help on the Timestamp Project

I’m still stuck on the Timestamp microservice project. I’ve spent a week re-writing my code and I’ve tried using the debugger in Chrome.

Not sure why it won’t work, since it should parse new Date(date_string) and { error : “Invalid Date” } should return. I’ve tried shortening and/or altering the routes but nothing is working. What am I missing?

Here’s a link to my glitch repo: https://glitch.com/edit/#!/fcc-timestamp-springstep

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0.

Challenge: Timestamp Microservice

Link to the challenge:

The tests are failing for input “05 October 2011” because you’re checking for “-” inside the string (which is missing for this case). If you read the failing test case carefully, you’ll have a hint what you should do:

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

So instead of creating your own parser with multiple if…else cases you should just pass the input to new Date() and check if the result is valid or not.

Also, you can (and should) remove :date? from url.

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