Show the invoice due date

React · React · intermediate · greenfield

Adds the DueDate component: parses the API date and renders it in the user's locale format. Displays correctly in manual testing.

Users are spread across US, EU and Asia timezones. A due date is a calendar date, not a moment in time.

Requirements

Files touched

--- src/components/DueDate.jsx
+export function DueDate({ isoDate }) {
+  const due = new Date(isoDate);
+  return (
+    <span className="due-date">
+      {due.toLocaleDateString(undefined, { month: "short", day: "numeric", year: "numeric" })}
+    </span>
+  );
+}

Review this PR

React practice