ionic-framework: bug: Cannot change AM/PM input in ion-datetime
Bug Report
Ionic version: [x] 4.x
Current behavior: Cannot change AM/PM input in ion-datetime element.
Expected behavior: Should be able to change AM/PM input in ion-datetime element.
Steps to reproduce:
- cd into cloned github project directory
- run ng serve
- open website in browser
- click rendered ion-datetime element
- try to change am/pm input
- see “Error parsing date: “[object Object]”. Please provide a valid ISO 8601 datetime format: https://www.w3.org/TR/NOTE-datetime” in console
Related code:
https://github.com/godspeed529/datetime-error-parsing-date
Other information: This regression was introduced in v4.5.0
Ionic info:
Ionic:
ionic (Ionic CLI) : 4.12.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.5.0
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1
System:
NodeJS : v10.14.1 (/usr/local/bin/node)
npm : 6.9.0
OS : macOS Mojave
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 11
- Comments: 35 (19 by maintainers)
Hi everyone,
I have created a dev build with the AM/PM datetime fix. If people could test with their apps and let me know if the issue is resolved for them, that would be great! (This is based off the latest
master, which has the 4.6.2 changes)Using Angular:
Using Ionic Core:
Thanks!
We fixed a bug that landed in 4.5.0 where changing the selected hour/minute/second etc did not refresh the picker values according to the
maxandminconstraints.That functionality should have been in there from the start, but there was a bug that prevented it from working. Had that bug not been in there, this current bug would have appeared. The AM/PM switching appeared to work only because another part of the datetime functionality was broken.
In reality, switching AM/PM should update which date/time values are displaying in
ion-datetimesince it is possible a user sets the max value to be something likeJune 28, 2019 5:30pm. WithJune 27, 2019selected, the user should be able to select past5:30pmbut not ifJune 28, 2019is selected.Hope this clears things up. I am currently investigating a fix, and I hope to have it land soon. Thanks!
Thanks! This issue has been fixed and will be released in Ionic 4.7.0. 🎉
@CitizenBeta Can you provide a test case of AM/PM reverting when changing the day? We are aware of an issue where that happens when changing the hour, but that seems to be unrelated to the changes made here.
Hoping to merge in the PR with this fix later today. I’ll create a dev build once it is merged for people who need access to the fix before the next release. Thanks!
100% in the same boat @CitizenBeta
We’re also running into this issue and is preventing us from a release. A fix for this would be greatly appreciated.
@topalavlad Thank you! I will take a look at the PR soon.
@brandyscarney can this issue get some love also. It is blocking our 4.6.x upgrade.