json-schema-org / json-schema-org/website
🐛 Bug: Community calendar events fail to sort on Safari/iOS due to invalid Date format
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 169
- Forks
- 484
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 6
Description
Describe the bug
The Community Calendar events list is failing to sort chronologically for users on Safari and iOS devices.
Currently, calendarUtils.ts formats dates as YYYY-MM-DD HH:mm:ss (e.g., 2024-10-15 14:30:00) before passing them into new Date() for sorting. This format is not strictly ISO 8601 compliant because it lacks the T separator.
While V8 browsers (Chrome, Edge) are forgiving and parse this correctly, WebKit (Safari/iOS) strictly follows the spec and evaluates new Date('2024-10-15 14:30:00') as NaN. This causes the array .sort() to fail, leaving the events list completely unsorted for Apple users.
Steps To Reproduce
- Open the JSON Schema community/events page on Safari (macOS or any browser on iOS).
- Notice that the upcoming events are not sorted chronologically.
- Open the Safari console and run
new Date('2024-10-15 14:30:00').getTime(). Observe that it returnsNaN.
Expected Behavior
Events should be listed in chronological order across all modern browsers.
Screenshots
No response
Device Information [optional]
- OS:
- Browser:
- version:
Are you working on this issue?
Yes
Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)
Yes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/calendarUtils.ts, where event dates are formatted before being passed to new Date() for sorting. Reproduce the invalid parsing behavior in Safari or iOS, then verify that the Community Calendar events are ordered chronologically across modern browsers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100