ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

fix(datetime): set working parts to last selected value

Open sean-perkins opened this issue 1 year ago • 4 comments

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
  • [x] 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).

sean-perkins avatar Jun 12 '24 05:06 sean-perkins

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 May 27, 2025 8:54pm

vercel[bot] avatar Jun 12 '24 05:06 vercel[bot]

Hey... what is the current status? Need the fix:-)

Keelback avatar Jul 07 '24 16:07 Keelback

@sean-perkins sorry for the ping, is this PR ready to be merged? Is there anything I can do to help (e.g. testing or dev)?

kemp avatar Jul 30 '24 19:07 kemp

Is there a timeline for fixing the bug? Or do you have a good workaround?

Keelback avatar Sep 20 '24 06:09 Keelback

hey, any update on this one? this is regression IMO because it was working correctly for me in previous versions

ggroven avatar Feb 06 '25 08:02 ggroven