Skip to content
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

Disable date segments and initialize it if they have only one possible value #139

Open
logaretm opened this issue Feb 23, 2025 · 0 comments
Labels
✨ enhancement New feature or request 🍰 p3-low Tasks that are nice-to-have. Like minor bugs, non-essential features, or cosmetic changes.

Comments

@logaretm
Copy link
Member

What

When providing a min/max to the date fields, there is little point in letting the user interact with all the segments if some segments have locked ranges.

A locked range can happen in these scenarios:

  • Min/Max have the same year, then year segment should be locked.
  • Min/Max have the same month and year, then both segments should be locked.

A general rule could be derived that a segment should be locked if all the min/max more significant date parts have equal value.

This is observable in the native HTML date fields, the very first example of the MDN demonstrates this

Image

Furthermore, locked segments can be safely initialized to that locked value, which is required since the user won't be able to edit them.

@logaretm logaretm added ✨ enhancement New feature or request 🍰 p3-low Tasks that are nice-to-have. Like minor bugs, non-essential features, or cosmetic changes. labels Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request 🍰 p3-low Tasks that are nice-to-have. Like minor bugs, non-essential features, or cosmetic changes.
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant