Back End Development and APIs Projects - Exercise Tracker

Tell us what’s happening:
The following test is not passing although the results of my app and the expected ones are identical: The response returned from POST /api/users/:_id/exercises will be the user object with the exercise fields added.

Your project link(s)

solution: boilerplate-project-exercisetracker - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

Challenge: Back End Development and APIs Projects - Exercise Tracker

Link to the challenge:

Your responds:

{
  username: 'fcc_test_16771035515',
  description: 'test',
  duration: 60,
  date: 'Mon Jan 1 1990',
  _id: '63f691c0e53b5f0e37e8eaad',
};

Example responds

{
  username: "fcc_test",
  description: "test",
  duration: 60,
  date: "Mon Jan 01 1990",
  _id: "5fb5853f734231456ccb3b05"
}

Look very closely.

I would use toDateString as suggested in the challenge

Edit: you can also use the 2-digit option instead of numeric for the day

Intl.DateTimeFormat() constructor - JavaScript | MDN

It works! I spent so much time looking for differences in the results that I just couldn’t see that tiny difference. Changed the day: "numeric" to day: "2-digit" in toLocaleDateString() for it to convert correctly.

Big thanks for the help :smiley:

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