🐛 Bug: Community calendar events fail to sort on Safari/iOS due to invalid Date format

Open Beginner friendly
#2,255 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
frontend

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.

Description

🐛 Bug invalid Status: Stale Status: Triage
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
  1. Open the JSON Schema community/events page on Safari (macOS or any browser on iOS).
  2. Notice that the upcoming events are not sorted chronologically.
  3. Open the Safari console and run new Date('2024-10-15 14:30:00').getTime(). Observe that it returns NaN.
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

Dominant language
HTML
Stars
169
Forks
484
Avg merge
7h 58m
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from json-schema-org/website

All issues in json-schema-org/website

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.