Skip to content

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

@h30s

Description

@h30s

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is the initial status for an issue that requires triage.invalidThis doesn't seem right🐛 BugIndicates that the issue is a bug or defect.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions