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): set working parts to last selected value #29610

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sean-perkins
Copy link
Contributor

Issue number: resolves #29604, #29094


What is the current behavior?

When assigning multiple selected dates that span different months, the date time will not set the correct working parts and instead fallback to the default date: May 28, 2021.

What is the new behavior?

When opening the datetime with multiple dates selected, the calendar will animate to the last value in the array of selected dates.

If the datetime is collapsed, body is not visible, is not a grid view or the user has made a selection of a new date, the calendar will not animate and instead will set the working parts to the current value selected (latest/last value).

Does this introduce a breaking change?

  • Yes
  • No

Other information

Internally we discussed setting the month view to the first value in the array. Upon further investigation I determined this is not the expected behavior. When a user interacts with multiple date selection, the most recent selection (their active view) is the last value in the array. Animating or updating the working parts to the first value in the array would result in the calendar month jumping after every selection. Using the last index of the array results in no odd jumps in the experience. If a developer wishes to configure this behavior, they can change the order of the values in the value assigned to the datetime (to cause a specific month/date to be the initial view).

Copy link

vercel bot commented Jun 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ionic-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 12, 2024 5:35am

@github-actions github-actions bot added the package: core @ionic/core package label Jun 12, 2024
@sean-perkins sean-perkins changed the title fix(datetime): set working parts to first selected value fix(datetime): set working parts to last selected value Jun 12, 2024
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.

bug: ion-datetime opens to incorrect date when multiple dates from different months are selected
1 participant