The whole project is working but the last test is not passing.
On further investigation i think the issue lies in comparing the dates residing in the database and the dates being sent in the query parameter.
I convert both to the Date object for comparison.
But the date stored in the database is in this format ‘Sun Jan 01 1995’
This converts to 1994-12-31T18:30:00.000Z
while the date sent in the query param being 1995 is converted to:
This 5:30 hr gap is probably due to me being in india and the Date() accounting for the local time. I am unable to figure out what to do about it.
Can someone suggest a way around or even a better way to deal with the problem?
Your project link(s)
Your browser information:
User Agent is:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36
Challenge: Exercise Tracker
Link to the challenge: