Skip to content

Parse date range with dashes #5578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 20, 2025
Merged

Parse date range with dashes #5578

merged 2 commits into from
Apr 20, 2025

Conversation

alexz-sg
Copy link
Contributor

Description

This PR addresses the issue with parsing date ranges when dateFormat contains dashes (-).

Problem
Currently, when entering a date manually via input using a dateFormat with dashes (such as dd-MM-yyyy), the startDate and endDate are not parsed correctly. The issue arises because the current parser uses .split('-'), which only captures parts of the first date.

Changes
This PR modifies the parser to use .split(' - ') as the default separator for date ranges. To avoid breaking changes, this adjustment is applied only to dateFormats that contain dashes.

Contribution checklist

  • I have followed the contributing guidelines.
  • I have added sufficient test coverage for my changes.
  • I have formatted my code with Prettier and checked for linting issues with ESLint for code readability.

@martijnrusschen martijnrusschen merged commit 2cc0554 into Hacker0x01:main Apr 20, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants