You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: datetime, current minutes shown even if not included in minuteValue field #24722
I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v4.x
v5.x
v6.x
Current Behavior
When using the ion-datetime component for time selection with minuteValue set, eg. to [0,15,30,45] and without an initial value, the current time is preselected. But if the time is 10:20 for example, the preselected minute is "00". Pressing the "Done" button of the time selector without changing the minute, will set the value to "10:20" - the current time. This does not correspond to the displayed value of the selector. To set a time of "11:00", the user has to change the hour value and also the minute value to any different than "00" and back to "00".
Expected Behavior
If the user confirms the current selection, the current shown value of the selector should be provided by the time selector as new value. And not a minutes value which the user has never selected or even seen.
Steps to Reproduce
Setup an ion-datetime component for time selection only
Enable the default buttons to display the "Done" button
Set minuteValue, eg. to "0,15,30,45"
Provide no initial value
Open the time selector and confirm the selected time via the "Done" button
The provided time value is the current time but not "00" as minutes as selected
changed the title [-]bug: [/-][+]bug: Preselected minutes value not submitted by ion-datetime when initial value does not match an item of minuteValues[/+]on Feb 4, 2022
changed the title [-]bug: Preselected minutes value not submitted by ion-datetime when initial value does not match an item of minuteValues[/-][+]bug: ion-datetime not sets the correct minute value in some cases if minuteValues are provided[/+]on Feb 4, 2022
I believe in instances where the developer passes minuteValue to filter the selection, we should likely ignore the current time and default to the lowest bounds of the minuteValue, in this case: 10:00.
The user should definitely not be able to confirm a time value that is inconsistent with the filtered time selections.
We will capture this as a bug and prioritize. Thanks!
changed the title [-]bug: ion-datetime not sets the correct minute value in some cases if minuteValues are provided[/-][+]bug: ion-datetime incorrect minute value when using minuteValue and current time[/+]on Feb 18, 2022
changed the title [-]bug: ion-datetime incorrect minute value when using minuteValue and current time[/-][+]bug: datetime, current time shown even if not included in minuteValue field[/+]on Aug 25, 2022
changed the title [-]bug: datetime, current time shown even if not included in minuteValue field[/-][+]bug: datetime, current minutes shown even if not included in minuteValue field[/+]on Aug 25, 2022
Please note that there is an existing bug where the wheel picker does not update the value property of datetime when using a default value. That is being tracked in #25839.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
[-]bug: [/-][+]bug: Preselected minutes value not submitted by ion-datetime when initial value does not match an item of minuteValues[/+][-]bug: Preselected minutes value not submitted by ion-datetime when initial value does not match an item of minuteValues[/-][+]bug: ion-datetime not sets the correct minute value in some cases if minuteValues are provided[/+]sean-perkins commentedon Feb 18, 2022
@mstichweh thanks for reporting this issue.
I believe in instances where the developer passes
minuteValueto filter the selection, we should likely ignore the current time and default to the lowest bounds of theminuteValue, in this case:10:00.The user should definitely not be able to confirm a time value that is inconsistent with the filtered time selections.
We will capture this as a bug and prioritize. Thanks!
[-]bug: ion-datetime not sets the correct minute value in some cases if minuteValues are provided[/-][+]bug: ion-datetime incorrect minute value when using minuteValue and current time[/+][-]bug: ion-datetime incorrect minute value when using minuteValue and current time[/-][+]bug: datetime, current time shown even if not included in minuteValue field[/+][-]bug: datetime, current time shown even if not included in minuteValue field[/-][+]bug: datetime, current minutes shown even if not included in minuteValue field[/+]liamdebeasi commentedon Oct 11, 2022
Thanks for the issue. Here is a dev build if you are interested in testing the proposed fix.
Please note that there is an existing bug where the wheel picker does not update the
valueproperty of datetime when using a default value. That is being tracked in #25839.liamdebeasi commentedon Oct 26, 2022
Thanks for the issue. This has been resolved via #26093, and a fix will be available in an upcoming release of Ionic Framework.
fix(datetime): account for allowed values when setting default date (#…
ionitron-bot commentedon Nov 25, 2022
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.