MCPcopy Create free account
hub / github.com/api-platform/website / sortByEventStartDate

Function sortByEventStartDate

pwa/api/events.ts:8–14  ·  view source on GitHub ↗
(eventA: Event, eventB: Event)

Source from the content-addressed store, hash-verified

6import { getAllContributors } from "./contributors";
7
8function sortByEventStartDate(eventA: Event, eventB: Event) {
9 const date1 = dayjs(eventA.startDate.date);
10 const date2 = dayjs(eventB.startDate.date);
11 if (date1.isBefore(date2)) return 1;
12 if (date1.isAfter(date2)) return -1;
13 return 0;
14}
15
16export async function getAllEvents(withContent?: boolean) {
17 const directory = "data/events";

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected