diff --git a/src/components/Schedule.jsx b/src/components/Schedule.jsx index 8d4e335..f68850e 100644 --- a/src/components/Schedule.jsx +++ b/src/components/Schedule.jsx @@ -4,8 +4,7 @@ import Image from 'next/image' import { Sessions } from "../../speakers"; import Link from "next/link"; import { Schedule as schedule } from "../../schedule"; -import {EVENT} from "../../event"; - +import { EVENT } from "../../event"; function DailySchedule({ day }) { // Day of the month @@ -45,73 +44,82 @@ function DailySchedule({ day }) { - {day.timeSlots.map((timeSlot) => ( - = moment(`${parsedDate} ${timeSlot.start.split('').filter((x) => x.toUpperCase() === x.toLowerCase()).join('')}:00`).unix() && - timeIrl < moment(`${parsedDate} ${timeSlot.end.split('').filter((x) => x.toUpperCase() === x.toLowerCase()).join('')}:00`).unix() + 5 * 60 && - moment(parsedDate).date() === parseInt(today) - ? "flex items-center bg-brand-400 justify-between" - : "flex items-center justify-between" - } - > - {timeSlot.session && ( - <> - - = startUnix && + timeIrl < endUnix + 5 * 60 && + currentDate === parseInt(today) + ? "flex items-center bg-brand-400 justify-between" + : "flex items-center justify-between" + } + > + {timeSlot.session && ( + <> + + - - - )} - {!timeSlot.session && ( - <> - - - - - )} - - ))} + ); + })} + + + + )} + {!timeSlot.session && ( + <> + + + + + )} + + ); + })}
- - {timeSlot.start} - {timeSlot.end} - - - {timeSlot.session.map((speaker) => { - return ( -
- -
- {Sessions[speaker].name} + {day.timeSlots.map((timeSlot) => { + // Build full datetime strings for start/end, using explicit format + const fullStart = `${parsedDate} ${timeSlot.start}:00`; + const fullEnd = `${parsedDate} ${timeSlot.end}:00`; + const startUnix = moment(fullStart, 'MM/DD/YYYY HH:mm:ss').unix(); + const endUnix = moment(fullEnd, 'MM/DD/YYYY HH:mm:ss').unix(); + const currentDate = moment(parsedDate, 'MM/DD/YYYY').date(); + + return ( +
+ + {timeSlot.start} - {timeSlot.end} + + + {timeSlot.session.map((speaker) => { + return ( +
+ +
+ {Sessions[speaker].name} +
+ + + {timeSlot.name ? timeSlot.name : Sessions[speaker].name} +
- - - {timeSlot.name ? timeSlot.name : Sessions[speaker].name} - - - ); - })} -
- - {timeSlot.description ? timeSlot.description : Sessions[timeSlot.session[0]]?.talkTitle} - - - {timeSlot.start} - {timeSlot.end} - - {timeSlot.name === 'Coffee, Snacks, Sponsors, Chat!' ? ( -
Coffee, Snacks, Sponsors, Chat!
- ) : timeSlot.name ? ( - timeSlot.name - ) : ( - Sessions[timeSlot.session].name - )} -
- {timeSlot.description ? timeSlot.description : Sessions[timeSlot.session]?.talkTitle} -
+ + {timeSlot.description ? timeSlot.description : Sessions[timeSlot.session[0]]?.talkTitle} + + + {timeSlot.start} - {timeSlot.end} + + {timeSlot.name === 'Coffee, Snacks, Sponsors, Chat!' ? ( +
Coffee, Snacks, Sponsors, Chat!
+ ) : timeSlot.name ? ( + timeSlot.name + ) : ( + Sessions[timeSlot.session]?.name + )} +
+ {timeSlot.description ? timeSlot.description : Sessions[timeSlot.session]?.talkTitle} +
@@ -144,3 +152,4 @@ export function Schedule() { ); } + diff --git a/testfile b/testfile new file mode 100644 index 0000000..3eae94f --- /dev/null +++ b/testfile @@ -0,0 +1 @@ +askdjfhjksdhfkahskdjfhaksfh