diff --git a/README.md b/README.md index 1c3888d..b77a430 100644 --- a/README.md +++ b/README.md @@ -11,21 +11,23 @@ The only other accepted format is an empty string, meaning the date has not been **Important:** Make sure to increment the id -```json +```ts [ { - "title": "Title of the event", - "description": "Description of the event", - "date": "04/22", - "location": "Engineering building", - "id": 0 + title: 'Title of the event', + description: 'Description of the event', + date: new Date('2025-01-22T17:00:00'), + location: 'The ideas hub (second floor of the engineering building)', + weekly: true, + endDate: new Date(semesterEnd) }, { - "title": "Title of the event 2", - "description": "Description of the event 2", - "date": "04/23", - "location": "Engineering building", - "id": 1 + title: 'Title of the event 2', + description: 'Description of the event 2', + date: new Date('2025-01-22T14:00:00'), + location: 'The ideas hub (second floor of the engineering building)', + weekly: true, + endDate: new Date(semesterEnd) } ] ``` diff --git a/package-lock.json b/package-lock.json index cc9fc92..64cdf97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "react-spinners": "^0.13.4", "typescript": "^4.7.4", "util": "^0.12.4", + "uuid": "^11.0.5", "web-vitals": "^2.1.4" }, "devDependencies": { @@ -16823,6 +16824,14 @@ "websocket-driver": "^0.7.4" } }, + "node_modules/sockjs/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/source-list-map": { "version": "2.0.1", "license": "MIT" @@ -18081,10 +18090,15 @@ } }, "node_modules/uuid": { - "version": "8.3.2", - "license": "MIT", + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.5.tgz", + "integrity": "sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist/esm/bin/uuid" } }, "node_modules/v8-to-istanbul": { diff --git a/package.json b/package.json index 9161dc6..541de0b 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "react-spinners": "^0.13.4", "typescript": "^4.7.4", "util": "^0.12.4", + "uuid": "^11.0.5", "web-vitals": "^2.1.4" }, "scripts": { diff --git a/src/data/EventsDatabase.tsx b/src/data/EventsDatabase.tsx index 515d1c9..3500cfd 100644 --- a/src/data/EventsDatabase.tsx +++ b/src/data/EventsDatabase.tsx @@ -14,8 +14,7 @@ const EVENT_INFO: EventObject[] = [ { title: 'Weekly Programming Meeting', description: 'The weekly meeting for the programming sub-team. Take a look at the code for the robot', - date: new Date('TBD'), - time: 'TBD', + date: new Date('2025-01-22T17:00:00'), location: 'The ideas hub (second floor of the engineering building)', weekly: true, endDate: new Date(semesterEnd) @@ -23,8 +22,7 @@ const EVENT_INFO: EventObject[] = [ { title: 'Weekly Electrical Meeting', description: 'The weekly meeting for the electrical sub-team. Talk about improved batteries, wiring, and more!', - date: new Date('1/22/2025'), - time: '6:00 PM', + date: new Date('2025-01-22T18:00:00'), location: 'The ideas hub (second floor of the engineering building)', weekly: true, endDate: new Date(semesterEnd) @@ -32,8 +30,7 @@ const EVENT_INFO: EventObject[] = [ { title: 'Weekly Mechanical Meeting', description: 'The weekly meeting for the mechanical sub-team. Learn about the design aspects of robot and 3D model parts.', - date: new Date('1/22/2025'), - time: '4:00 PM', + date: new Date('2025-01-22T16:00:00'), location: 'The ideas hub (second floor of the engineering building)', weekly: true, endDate: new Date(semesterEnd) diff --git a/src/pages/events/EventList.tsx b/src/pages/events/EventList.tsx index bef2467..55cdf3a 100644 --- a/src/pages/events/EventList.tsx +++ b/src/pages/events/EventList.tsx @@ -24,7 +24,7 @@ class EventList extends React.Component<{events: EventObject[], loading: boolean
Location: {event.location}
-Time: {event.time === '' ? 'TBD' : event.time}
+Time: {event.tbd ? 'TBD' : toTimeString(event.date)}
Description: {event.description}
@@ -35,4 +35,11 @@ class EventList extends React.Component<{events: EventObject[], loading: boolean } } +function toTimeString (date: Date): string { + const time = date.toTimeString().split(' ')[0].split(':') + const hours = parseInt(time[0]) + const minutes = time[1] + return `${hours % 12}:${minutes} ${hours >= 12 ? 'PM' : 'AM'}` +} + export default EventList diff --git a/src/pages/general/photo-gallery/PhotoGallery.tsx b/src/pages/general/photo-gallery/PhotoGallery.tsx index 206b469..8de61cc 100644 --- a/src/pages/general/photo-gallery/PhotoGallery.tsx +++ b/src/pages/general/photo-gallery/PhotoGallery.tsx @@ -2,6 +2,7 @@ import React from 'react' import $ from 'jquery' import { BsChevronLeft, BsChevronRight, BsDashLg } from 'react-icons/bs' +import {v4 as uuid} from 'uuid' // Custom styles import Styles, { PhotoGalleryProps, GallerySlideProps } from './PhotoGalleryStyles' @@ -9,11 +10,12 @@ import Styles, { PhotoGalleryProps, GallerySlideProps } from './PhotoGalleryStyl // General tools import { ANIMATION_TIME, COLORS } from '../../../tools/Constants' -export default class PhotoGallery extends React.Component