From 32b8dd6d257e11322a41b906bc654c34ce575a3b Mon Sep 17 00:00:00 2001 From: "david.truong" <david.truong@hes-so.ch> Date: Tue, 18 Apr 2023 16:58:16 +0200 Subject: [PATCH] =?UTF-8?q?Enlever=20boutons=20annuler=20des=20cartes=20re?= =?UTF-8?q?ndez-vous=20d=C3=A9j=C3=A0=20pass=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile_app/components/RDVCard.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mobile_app/components/RDVCard.js b/mobile_app/components/RDVCard.js index 6a2d7bb1e..60acec79f 100755 --- a/mobile_app/components/RDVCard.js +++ b/mobile_app/components/RDVCard.js @@ -64,6 +64,9 @@ const ConfirmDelete = (data, up) => { const RDVCard = ({ data, up }) => { const navigation = useNavigation(); + const today = new Date() + const dateCard = new Date(data.date) + console.log(data.date) return ( <View style={{ backgroundColor: COLORS.white, borderRadius: SIZES.font, marginBottom: SIZES.extraLarge, margin: SIZES.base, ...SHADOWS.dark}}> <View style={{ width: "100%", height: 150 }}> @@ -82,7 +85,7 @@ const RDVCard = ({ data, up }) => { <View style={{ flexDirection: "row"}}> <RectButton minWidth={85} fontSize={SIZES.font} text="Détails" handlePress={() => navigation.navigate("Details", { data })}/> - <RectButton minWidth={85} fontSize={SIZES.font} text="Annuler" handlePress={() => ConfirmDelete(data, up)}/> + {(today <= dateCard) && (<RectButton minWidth={85} fontSize={SIZES.font} text="Annuler" handlePress={() => ConfirmDelete(data, up)}/>)} </View> </View> -- GitLab