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

fix(datetime): navigate to month within min range #24759

Merged
merged 2 commits into from
Feb 9, 2022
Merged

fix(datetime): navigate to month within min range #24759

merged 2 commits into from
Feb 9, 2022

Conversation

sean-perkins
Copy link
Contributor

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

When providing a min value to ion-datetime that includes a day, the month of the min value will be disabled and once you have navigated away from it, you will be unable to return to it.

This is because the isBefore/isAfter checks additionally compare the day value, when min/max includes it. This is correct for date comparisons, but isn't a 1:1 with rules surrounding disabling months.

Issue Number: #24757

What is the new behavior?

Users can navigate to min/max months, when the min/max value includes a day constraint.

i.e.: If the min is 2022-02-09, users should still be able to navigate to February, since days 10-28 are enabled.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@sean-perkins sean-perkins requested a review from a team as a code owner February 9, 2022 18:03
@github-actions github-actions bot added the package: core @ionic/core package label Feb 9, 2022
Copy link
Contributor

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add comments to the code as to why we are passing in day: null? Otherwise this looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants