Exercise 2: Why .slice(0, 10) Is Needed Here and Not in the Sibling — Possible Solution ==================================================================== WHAT EACH DASHBOARD ACTUALLY RECEIVES ------------------------------ The sibling course's expiry_date column is plain TEXT, and better-sqlite3 hands back exactly what's stored - a simple string like "2026-09-01", with nothing added or changed. That string is already in the exact shape a dashboard would want to display. This course's expiryDate field is typed DateTime. When Prisma Client reads it, it comes back as a real JavaScript Date object on the server. Express's res.json() then serializes that Date object to JSON - and a JS Date always serializes to a complete ISO-8601 timestamp, including a time component and timezone marker, something like "2026-09-01T00:00:00.000Z", never just the date portion alone. WHY THE FIX IS NEEDED ------------------------------ Displaying item.expiryDate directly in this course would show that entire timestamp string to the user, time component and all - not what a "expires on this date" label should look like. item.expiryDate.slice (0, 10) takes just the first ten characters, which for an ISO-8601 string is exactly the YYYY-MM-DD date portion, giving a clean result comparable to what the sibling course already had for free. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly explains that the underlying values are different kinds of things by the time they reach the frontend - a plain stored string versus a Date object forced through JSON's own date-serialization behavior - rather than describing this as an arbitrary or unexplained difference between the two courses.