BCStudentSoftwareDevTeam / celts

Web app to support the CELTS program at Berea College
BSD 3-Clause "New" or "Revised" License
1 stars 8 forks source link

fixed date past rendering issue #1211

Closed ali-ramazani closed 2 weeks ago

ali-ramazani commented 2 weeks ago

There was an issue in the isPast property which was responsible for displaying a box with the text "Event already passed". We figured out that the property was returning True or False only based on current time comparison with start time of the event. To fix this, we compared current time with end date of the event.

Resolves issue #1166

CollegeStevenLN commented 2 weeks ago

For the property eventPast, it was defined by being greater than the start date and time. Logically, the event has only already pasted when the current time is greater than the end date and time.

ali-ramazani commented 2 weeks ago

We noticed a build error after changing the logic of the isPast Event property. To fix the issue, we added a new property with the new logic.

ali-ramazani commented 2 weeks ago

There were 4 variables with very identical names, which made understanding the code harder. We refactored the whole codebase and only used 2 variables to make the event time more intuitive. Specifically, we are using isPastStart and isPastEnd to refer to the start and end of an event in the past.

github-actions[bot] commented 2 weeks ago

View Code Coverage