Skip to content

Allow events to have a "TBD" or "All Day" time - #302

Merged
karasowles merged 5 commits into
github:mainfrom
cthow83:main
Apr 26, 2025
Merged

karasowles merged 5 commits into
github:mainfrom
cthow83:main

Conversation

@cthow83

@cthow83 cthow83 commented Apr 25, 2025 •

Copy link
Copy Markdown
Contributor

#245

Context

Currently they must have a specific time range within the one day, which is limiting for future events, and limiting for all day, multi-day conferences. At present, if anything except a specific UTC time range is entered, the event does not appear on the site.

Changes

  • Updated template for events to accept and end date
  • Updated event api to handle end date and return a suitable date string
  • Updated event api to handle when start and end time are not a UTC time (TBD is displayed instead)
  • Updated date pill to display a date rage for multi day events

Important

"All Day" has not been added, currently it will show a multi day pill at the top of the event and the start and end times as normal. This could/should be updated to not display times on a multi day event

  • Added tests

Testing

A few tests have been added. It's also possible to show it on the page by updating the content of the events.

E.G.

Demo Screenshot

Screenshot 2025-04-25 at 23 33 29 Screenshot 2025-04-25 at 23 33 09

Copilot AI review requested due to automatic review settings April 25, 2025 23:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the events system to allow for events to have a "TBD" time or span multiple days by incorporating an optional end date and adjusting the API’s date formatting behavior.

  • Updated event API to handle an optional end date and fallback to "TBD" for non-UTC start times.
  • Modified event templates and tests to support events with a range of dates.
  • Updated the events list display to show a date range for multi-day events.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/testData/2025-05-02-typewind.js New test data with an invalid start time to exercise fallback logic.
tests/testData/2025-05-02-Cookie-Cutter.js New test data supporting multi-day events with an end date.
tests/events.test.js Added tests covering end dates and fallback behavior for invalid start times.
components/events-list/EventsList.jsx Updated UI to display a date range when an end date is provided.
api/events.js Updated event parsing to include an end date and adjust time fallback logic.
.github/ISSUE_TEMPLATE/add-to-calendar.yml Updated template for consistency in quoting and added an optional end date field.
Comments suppressed due to low confidence (1)

api/events.js:117

  • Missing explicit check for 'TBD' in startTime handling may lead to an attempt to parse invalid time strings. Consider reverting to the previous condition (startTime && startTime !== TBD) to correctly default invalid times to 'TBD'.
if (startTime) {

Comment thread tests/events.test.js Resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

@karasowles karasowles left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - thank you for tackling this so thoroughly and cleaning up a bit while you were in there too!

@karasowles
karasowles merged commit 2a515e0 into github:main Apr 26, 2025
@karasowles

Copy link
Copy Markdown
Contributor

5pm on a Friday, the perfect time to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants