From d1c0b73210a4ce078d42128b784c35fdc5e06df9 Mon Sep 17 00:00:00 2001 From: Duc bao Date: Mon, 20 Feb 2023 17:32:17 +0700 Subject: [PATCH 1/2] adding online milestone to the member recruitment --- .../MemberRecuritment/components/Element.js | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/routes/MemberRecuritment/components/Element.js b/src/routes/MemberRecuritment/components/Element.js index 21df5fc..a5c1293 100644 --- a/src/routes/MemberRecuritment/components/Element.js +++ b/src/routes/MemberRecuritment/components/Element.js @@ -28,6 +28,7 @@ import localStorageUtils from '@/utils/localStorageUtils'; import productApi from '@/utils/productApi'; import { ExclamationCircleOutlined } from '@ant-design/icons'; import PublicIcon from '@mui/icons-material/Public'; +import PublicOffIcon from '@mui/icons-material/PublicOffOutlined'; function Element({ event }) { const [showMileStone, setShowMileStone] = useState(false); @@ -39,7 +40,13 @@ function Element({ event }) { var newDate = date.getDate() + '/' + (date.getMonth() + 1) + '/' + date.getFullYear() + ' '; return newDate; } - + function isDateValid(dateString) { + const currentDate = new Date(); + const [day, month, year] = dateString.split('/'); + const inputDate = new Date(year, month - 1, day); // month is 0-based in Date constructor + console.log(inputDate <= currentDate); + return inputDate <= currentDate; + } const [edit, setEdit] = useState(false); const handleOpenEdit = (event) => { event.stopPropagation(); @@ -94,7 +101,11 @@ function Element({ event }) {
- + {isDateValid(ChangeFormatDate(event.startTime)) ? ( + + ) : ( + + )}
{event.title}
@@ -133,7 +144,11 @@ function Element({ event }) {
- + {isDateValid(ChangeFormatDate(event.startTime)) ? ( + + ) : ( + + )}
{event.title}
From 625ea543649d651c01e9ebd96e974d054f0ab809 Mon Sep 17 00:00:00 2001 From: Duc bao Date: Mon, 20 Feb 2023 17:33:21 +0700 Subject: [PATCH 2/2] adding online milestone to the member recruitment --- src/routes/MemberRecuritment/components/Element.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/MemberRecuritment/components/Element.js b/src/routes/MemberRecuritment/components/Element.js index a5c1293..2f5c60e 100644 --- a/src/routes/MemberRecuritment/components/Element.js +++ b/src/routes/MemberRecuritment/components/Element.js @@ -44,7 +44,6 @@ function Element({ event }) { const currentDate = new Date(); const [day, month, year] = dateString.split('/'); const inputDate = new Date(year, month - 1, day); // month is 0-based in Date constructor - console.log(inputDate <= currentDate); return inputDate <= currentDate; } const [edit, setEdit] = useState(false);