updating hackathons list to be in chronological order

This commit is contained in:
Toby Brown 2023-12-03 12:14:32 +00:00
parent c04cfeba21
commit ddf619892b
2 changed files with 6 additions and 7 deletions

View file

@ -1,10 +1,8 @@
import CardModel from './card-model'
import { Box, Flex, Grid, Image, Link, Text } from 'theme-ui'
import { useState, useEffect } from 'react'
import {Box, Flex, Grid, Image, Link, Text} from 'theme-ui'
import Buttons from './button'
import ScrollingHackathons from '../../hackathons/scrolling-hackathons'
import Dot from '../../dot'
import { formatDate } from '../../../lib/dates'
import {formatDate} from '../../../lib/dates'
/** @jsxImportSource theme-ui */
const Cover = () => (

View file

@ -1,7 +1,7 @@
import { Badge, Box, Button, Card, Flex, Grid, Heading, Link, Text } from 'theme-ui'
import React, { useEffect, useRef, useState } from 'react'
import {Badge, Box, Button, Card, Flex, Grid, Heading, Link, Text} from 'theme-ui'
import React, {useEffect, useRef, useState} from 'react'
import Head from 'next/head'
import { useRouter } from 'next/router'
import {useRouter} from 'next/router'
import Meta from '@hackclub/meta'
import Nav from '../components/nav'
import BGImg from '../components/background-image'
@ -1225,6 +1225,7 @@ export async function getStaticProps() {
} catch (error) {
hackathonsData = [] // or some default value if an error occurs
}
hackathonsData.sort((a, b) => new Date(a.start) - new Date(b.start));
let events = await fetch(
'https://events.hackclub.com/api/events/upcoming/'