Skip to content

Commit

Permalink
fix(canteen): dates
Browse files Browse the repository at this point in the history
  • Loading branch information
raphckrman committed Nov 21, 2024
1 parent a26953a commit a134e37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/views/account/Restaurant/Modals/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ const RestaurantHistory = ({ route }: { route: NavigationProps }) => {
histories.sort((a, b) => b.timestamp - a.timestamp);

histories.forEach((history: ReservationHistory) => {
const formattedDate = formatDate(history.timestamp); // formatDate() retourne une chaîne formatée
const formattedDate = formatDate(history.timestamp);
if (!historyMap.has(formattedDate)) {
historyMap.set(formattedDate, []);
}
historyMap.get(formattedDate)?.push(history);
});

historyMap.forEach((value) => {
value.sort((a, b) => b.timestamp - a.timestamp); // Trier les éléments dans chaque groupe
value.sort((a, b) => b.timestamp - a.timestamp);
});

return Array.from(historyMap);
Expand Down

0 comments on commit a134e37

Please sign in to comment.