fix(front): Fix event list month order

Closes #1244

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-04-21 10:18:22 +02:00
parent 35b07dceaa
commit 63c9ed62de
7 changed files with 68 additions and 31 deletions

View File

@@ -22,8 +22,9 @@ const props = withDefaults(
defineProps<{
events: IEvent[];
isCurrentActorMember?: boolean;
order: "ASC" | "DESC";
}>(),
{ isCurrentActorMember: false }
{ isCurrentActorMember: false, order: "ASC" }
);
const monthlyGroupedEvents = computed((): Map<string, IEvent[]> => {
@@ -48,7 +49,9 @@ const keys = computed((): string[] => {
number
];
const bDate = new Date(...bParams);
return bDate.getTime() - aDate.getTime();
return props.order === "DESC"
? bDate.getTime() - aDate.getTime()
: aDate.getTime() - bDate.getTime();
});
});