From 29b1ac3792555894f486b14c63920e50dfab10b4 Mon Sep 17 00:00:00 2001 From: Ali Date: Wed, 10 Jun 2020 19:37:21 +0300 Subject: [PATCH] added a submitted date column relates #206 --- .../pages/admin/Submitted_all/index.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/client/src/components/pages/admin/Submitted_all/index.js b/client/src/components/pages/admin/Submitted_all/index.js index 8bb2580..d6c311b 100644 --- a/client/src/components/pages/admin/Submitted_all/index.js +++ b/client/src/components/pages/admin/Submitted_all/index.js @@ -17,7 +17,10 @@ const Header = { { title: 'Name', field: 'fullName', width: '20%' }, { title: 'Email', field: 'email', width: '20%' }, { title: 'Mobile', field: 'mobileNumber' }, - { title: 'Age', field: 'age' }, + { + title: 'Submitted Date', + field: 'applicationSubmittedDate', + }, { title: 'Academy Location', field: 'location' }, { title: 'Address', field: 'address' }, { @@ -40,7 +43,17 @@ const SubmittedApplications = () => { const [submitted, setSubmitted] = useState(); useEffect(() => { - if (!submitted) getSubmitted().then(setSubmitted); + if (!submitted) + getSubmitted() + .then((arr) => + arr.map((obj) => ({ + ...obj, + applicationSubmittedDate: obj.applicationSubmittedDate.split( + 'T' + )[0], + })) + ) + .then(setSubmitted); }, [submitted]); return (