Skip to content

Commit

Permalink
events currentornext
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobc2700 committed May 30, 2024
1 parent 1b02a24 commit 7ae1f8e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/services/events/events-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ eventsRouter.get("/currentOrNext", async (req, res, next) => {
let nextEvent = null;

for (const event of events) {
if (
event.startTime <= currentTime &&
event.endTime >= currentTime
) {
let startTime: Date = event.startTime as Date;

Check failure on line 18 in src/services/events/events-router.ts

View workflow job for this annotation

GitHub Actions / lint

'startTime' is never reassigned. Use 'const' instead
let endTime: Date = event.endTime as Date;

Check failure on line 19 in src/services/events/events-router.ts

View workflow job for this annotation

GitHub Actions / lint

'endTime' is never reassigned. Use 'const' instead

if (startTime <= currentTime && endTime >= currentTime) {
currentEvent = event;
break;
} else if (event.startTime > currentTime) {
} else if (startTime > currentTime) {
nextEvent = event;
break;
}
Expand Down

0 comments on commit 7ae1f8e

Please sign in to comment.