fix(front): Fix event list month order
Closes #1244 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user