diff --git a/Front-end/src/pages/Home.jsx b/Front-end/src/pages/Home.jsx
index 937bbd2..70627df 100644
--- a/Front-end/src/pages/Home.jsx
+++ b/Front-end/src/pages/Home.jsx
@@ -26,12 +26,13 @@ import { API_BASE_URL } from "../config";
function EnhancedWeatherHome() {
const [searchQuery, setSearchQuery] = useState("");
const [locations, setLocations] = useState([]);
- const [infoMeteo,setInfoMeteo] = useState([]);
+ const [infoMeteo, setInfoMeteo] = useState([]);
const [activeFilter, setActiveFilter] = useState("all");
const [currentTime, setCurrentTime] = useState(new Date());
const { user, token } = useAuth();
const [ville, setVille] = useState("Paris, France");
- const isDayTime = currentTime.getHours() > 6 && currentTime.getHours() < 20;
+ const heure = currentTime.getHours();
+ const isDayTime = heure > 6 && heure < 20;
useEffect(() => {
const timer = setInterval(() => {
@@ -43,7 +44,7 @@ function EnhancedWeatherHome() {
useEffect(() => {
axios
.post(`${API_BASE_URL}/getMeteoHome`, {
- location:ville,
+ location: ville,
})
.then((response) => {
if (response.data.length === 0) {
@@ -80,34 +81,38 @@ function EnhancedWeatherHome() {
return date.toLocaleDateString("fr-FR", options);
};
+ const formatHeure = (h) => {
+ const heureFormatee = (h % 24).toString().padStart(2, "0"); // 0 → 00, 3 → 03, etc.
+ return `${heureFormatee}:00`;
+ };
const hourlyForecast = [
{
time: "Maintenant",
- temp: infoMeteo.temperature+"°",
- icon: