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, 2026 and Feb 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?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
Yes I am willing to submit a PR!
Describe the bug.
The
getEventStatusfunction 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":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."
19-20, February 2026"Feb 19, 2026andFeb 20, 2026.Screenshots
How to Reproduce
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]
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
Yes I am willing to submit a PR!