Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[X ] 3.x
I'm submitting a ... (check one with "x")
[X ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
In Ionic DateTime component when setting time with 12-hour format with AM/PM the time a 2018-01-01T00:00:00 comes as 1:00 AM in the picker menu but correct in display mode.
Expected behavior:
The expected behavior should be the date time picker should select 2018 12:00 AM value for time value of 2018-01-01T00:00:00
Steps to reproduce:
Create a DateTime component of ionic and set the picker time format to 12 hours with am/pm and set the time to 00:00:00 hours. The picker date comes as 1:00 AM while it should have 12:00 AM
Plunker example
Hello, thanks for opening an issue with us, we will look into this.
Ok
Thanks for looking into the bug
You can see the bug in https://ionicframework.com/docs/api/components/datetime/DateTime/ by changing time to 12:00:00 am and clicking the item again.
The bug affects time that start with 00:xx:xx not just 00:00:00.
Any chance of this getting fixed? I am also experiencing this issue.
@jgerstle - once we are done with the next major release of Ionic, we will be going back through issues like this to determine which ones are still issues. I have marked this issue as one that we should be sure and look at closely at that time.
We ran into this issue recently and this is what I see in the debugger...
getValueFromFormat called from method DateTime.prototype.generate in datetime.js is returning 0 in this scenario (as correctly set by updateDate) and the column values for the hours column are 1 - 12 so nothing matches, selectedIndex is set to -1 and the picker column "current value" for hours is left unset... which makes "1" the current wheel position.
Thanks for the issue! We have moved the source code and issues for Ionic 3 into a separate repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.
Thank you for using Ionic!
Issue moved to: https://github.com/ionic-team/ionic-v3/issues/751
Most helpful comment
@jgerstle - once we are done with the next major release of Ionic, we will be going back through issues like this to determine which ones are still issues. I have marked this issue as one that we should be sure and look at closely at that time.