¿Qué estoy haciendo mal? ¿Cómo hago para que mi proyecto maneje fechas con Date(date_string)?)

Cuéntanos qué está pasando:
“Tu proyecto puede manejar fechas que pueden ser analizadas con éxito por new Date(date_string)” Y estoy usando New Date.
No comprendo muy bien a lo que se refiere ese requerimiento del proyecto

Enlace(s) de tu proyecto

solution: https://replit.com/@michael-liendo/boilerplate-project-timestamp

Información de tu navegador:

El agente de usuario es: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36

Desafío: Microservicio de marca de tiempo

Enlaza al desafío:

I put your server url into the project submission and submit it. I then open up the browser dev tools and look into the network tab (learn how to do this if you don’t know how - I spend a lot of time in the browser network and console tabs when debugging) I see the API call for the test that failing:

  1. Request URL: https://boilerplate-project-timestamp.michael-liendo.repl.co/api/05%20October%202011
  2. Request Method: GET
  3. Status Code: 200

and the response is:

{"error":"Invalid Date"}

So, it is submitting:


If we realize that “%20” is just an escape character for a space (20 in hex, 32 in decimal), then we are really checking this date:

05 October 2011

I would try to figure out why that date is not working.

1 Like

Thanks you! without knowing that I could not solve it

This is how you learn. A lot of a devs time is spent doing google searches, trying to figure things out.

I wish FCC could spend more time teaching debugging like this, but it would be boring and doesn’t really lend itself to the FCC format. I’m sure that FCC has some videos on it, though.