-
-
Notifications
You must be signed in to change notification settings - Fork 205
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug.
The getEventStatus function in utils/status.ts uses a simple .split('-') method to identify date ranges. While this works for standard ISO formats, it fails on the human-readable format used in city-lists.json (e.g., "19-20, February 2026").
The Technical Failure:
When the code encounters "19-20, February 2026":
- It splits the string into ["19", "20, February 2026"].
- new Date("19") returns Invalid Date.
- new Date("20, February 2026") returns a valid Date object.
Since the startDate becomes invalid, all subsequent comparison logic (today >= startDate) fails, leading to incorrect event statuses (Upcoming/Ongoing/Ended) being displayed on the UI.
Expected behavior
The parser should be intelligent enough to realize that "19" and "20" both belong to "February 2026."
- Input: "
19-20, February 2026" - Expected Output: An array containing two valid Date objects:
Feb 19, 2026andFeb 20, 2026.
Screenshots
How to Reproduce
- Open utils/status.ts.
- Go to line 5, which contains the problematic line.
- Run the following command in the terminal:
console.log(new Date('30 September - 1 October, 2026'.split('-')[0]))
You will clearly see the issue. It should interpret the date as 30 September 2026, but instead it is parsed as 30 September 2001 due to the way JavaScript's Date parser handles incomplete date strings.
🖥️ Device Information [optional]
- Operating System (OS):Mac
- Browser:Arc
- Browser Version:
👀 Have you checked for similar open issues?
- I checked and didn't find similar issue
🏢 Have you read the Contributing Guidelines?
- I have read the Contributing Guidelines
Are you willing to work on this issue ?
Yes I am willing to submit a PR!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working