From 468c04cf741cafb5e4238e1a747651c6add6ab93 Mon Sep 17 00:00:00 2001 From: Wagner Trezub Date: Fri, 25 Oct 2024 16:55:45 +0200 Subject: [PATCH] fix: file cleaned --- src/components/ItaliaTheme/Blocks/Alert/View.jsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/ItaliaTheme/Blocks/Alert/View.jsx b/src/components/ItaliaTheme/Blocks/Alert/View.jsx index a49627c47..09d205195 100644 --- a/src/components/ItaliaTheme/Blocks/Alert/View.jsx +++ b/src/components/ItaliaTheme/Blocks/Alert/View.jsx @@ -19,7 +19,7 @@ import Dates from './Dates'; * @extends Component */ const View = (props) => { - const { data, pathname } = props; + const { data } = props; const userLogged = useSelector((state) => state.userSession.token); const content = data.text @@ -31,12 +31,11 @@ const View = (props) => { : ''; const currentDate = new Date(); - const startDateObj = data.startDate ? new Date(data.startDate) : null; // Convertire la data di inizio in oggetto Date - const endDateObj = data.endDate ? new Date(data.endDate) : null; // Convertire la data di fine in oggetto Date + const startDateObj = data.startDate ? new Date(data.startDate) : null; + const endDateObj = data.endDate ? new Date(data.endDate) : null; - // Verificações para garantir que o alerta é ativo - const isStartActive = startDateObj ? startDateObj <= currentDate : true; // A data de início deve ser anterior ou igual à atual - const isEndActive = endDateObj ? endDateObj >= currentDate : true; // A data de fim deve ser posterior ou igual à atual + const isStartActive = startDateObj ? startDateObj <= currentDate : true; + const isEndActive = endDateObj ? endDateObj >= currentDate : true; const isAlertActive = startDateObj && endDateObj