fix merge
This commit is contained in:
1 parent
46d6a8ab60
commit
2beb998c50
3 files changed
+17
-7
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import styles from "./IncompleteEvent.module.css";
|
import styles from "./IncompleteEvent.module.css";
|
||||||
import getAllEvents from "../../utils/event/getAllEvents";
|
import getAllEvents from "../../utils/events/getAllEvents";
|
||||||
|
|
||||||
function IncompleteEvent() {
|
function IncompleteEvent() {
|
||||||
const [events, setEvents] = useState([]);
|
const [events, setEvents] = useState([]);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Doughnut } from "react-chartjs-2";
|
|||||||
import { Chart, ArcElement } from "chart.js";
|
import { Chart, ArcElement } from "chart.js";
|
||||||
import { MenuItem, Select, FormControl } from "@mui/material";
|
import { MenuItem, Select, FormControl } from "@mui/material";
|
||||||
import styles from "./ParticipationChart.module.css";
|
import styles from "./ParticipationChart.module.css";
|
||||||
import getAllEvents from "../../utils/event/getAllEvents";
|
import getAllEvents from "../../utils/events/getAllEvents";
|
||||||
|
|
||||||
Chart.register(ArcElement);
|
Chart.register(ArcElement);
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,23 @@
|
|||||||
|
|
||||||
|
|
||||||
export function formatDateLetter(d) {
|
export function formatDateLetter(d) {
|
||||||
|
if (!d) return "Date inconnue";
|
||||||
|
|
||||||
|
const dateObj = new Date(d);
|
||||||
|
if (isNaN(dateObj.getTime())) return "Date invalide";
|
||||||
|
|
||||||
const monthNames = [
|
const monthNames = [
|
||||||
"Janvier", "Février", "Mars", "Avril", "Mai", "Juin",
|
"Janvier", "Février", "Mars", "Avril", "Mai", "Juin",
|
||||||
"Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"
|
"Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"
|
||||||
];
|
];
|
||||||
|
|
||||||
const [datePart, timePart] = d.split(' ');
|
const day = dateObj.getDate().toString().padStart(2, "0");
|
||||||
const [year, month, day] = datePart.split('-');
|
const month = monthNames[dateObj.getMonth()];
|
||||||
const [hours, minutes] = timePart.split(':');
|
const year = dateObj.getFullYear();
|
||||||
|
const hours = dateObj.getHours().toString().padStart(2, "0");
|
||||||
|
const minutes = dateObj.getMinutes().toString().padStart(2, "0");
|
||||||
|
|
||||||
return `${day} ${monthNames[parseInt(month, 10) - 1]} ${year} à ${hours}:${minutes}`;
|
return `${day} ${month} ${year} à ${hours}:${minutes}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -19,4 +28,5 @@ export function formatDateLetterJS(d) {
|
|||||||
];
|
];
|
||||||
const [year, month, day] = d.split('-');
|
const [year, month, day] = d.split('-');
|
||||||
return `${day} ${monthNames[parseInt(month) - 1]} ${year}`;
|
return `${day} ${monthNames[parseInt(month) - 1]} ${year}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in new issue
Block a user