Tell us what’s happening:
My solution currently passes all the tests except for the " Failed:Your project can handle dates that can be successfully parsed by new Date(date_string)" one. I’d really appreciate if you can help me out
Your project link(s)
solution: (for some reason, the forum isn’t allow me post the link to the deployed api, but it’s right there in my repo README)
The string ‘05 October 2011, GMT’ does not match any of your conditions and gets passed to this code.
res.json({
"unix": Number(req.params.date),
"utc": new Date(Number(req.params.date)).toUTCString()
})
Incorrectly parsed
Number('05 October 2011, GMT')
NaN
JSON.stringify(Number('05 October 2011, GMT'))
'null'
new Date(Number('05 October 2011, GMT')).toUTCString()
'Invalid Date'
Correctly parsed:
new Date('05 October 2011, GMT')
Wed Oct 05 2011 02:00:00 GMT+0200 (Central European Summer Time)