diff --git a/client/package-lock.json b/client/package-lock.json index ad3756210a..21f6775b12 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -9049,9 +9049,9 @@ } }, "date-fns": { - "version": "1.30.1", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz", - "integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==" + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.16.1.tgz", + "integrity": "sha512-sAJVKx/FqrLYHAQeN7VpJrPhagZc9R4ImZIWYRFZaaohR3KzmuK88touwsSwSVT8Qcbd4zoDsnGfX4GFB4imyQ==" }, "debug": { "version": "2.6.9", diff --git a/client/package.json b/client/package.json index 1fd4ef6728..c2a0b47031 100644 --- a/client/package.json +++ b/client/package.json @@ -27,7 +27,7 @@ "browser-cookies": "^1.2.0", "chai": "^4.2.0", "csrf": "^3.1.0", - "date-fns": "^1.30.1", + "date-fns": "^2.16.1", "entities": "^1.1.2", "enzyme": "^3.10.0", "enzyme-adapter-react-16": "^1.15.5", diff --git a/client/src/client-only-routes/ShowCertification.js b/client/src/client-only-routes/ShowCertification.js index f2b2cd03bf..aa861a912f 100644 --- a/client/src/client-only-routes/ShowCertification.js +++ b/client/src/client-only-routes/ShowCertification.js @@ -34,7 +34,7 @@ const propTypes = { certName: PropTypes.string, certTitle: PropTypes.string, completionTime: PropTypes.number, - date: PropTypes.string + date: PropTypes.number }), certDashedName: PropTypes.string, certName: PropTypes.string, @@ -193,14 +193,14 @@ class ShowCertification extends Component { } const { - date: issueDate, + date, name: userFullName, username, certTitle, completionTime } = cert; - const certDate = new Date(issueDate); + const certDate = new Date(date); const certYear = certDate.getFullYear(); const certMonth = certDate.getMonth(); const certURL = `https://freecodecamp.org${pathname}`; @@ -282,9 +282,9 @@ class ShowCertification extends Component {