I have two small problems with ion-datetime
Case 1: In the first case, I do not know why, when I click on it, the following error is thrown out.
<ion-datetime class="ocultar datetime datetime-ios ng-untouched ng-pristine ng-valid" displayformat="DDD DD de MMMM YYYY , hh:mm A" max="2050" ng-reflect-min="18/4/2018 15:21:25" ng-reflect-max="2050" ng-reflect-display-format="DDD DD de MMMM YYYY , hh:mm A" ng-reflect-model="2018-04-25T17:58" id="date1"><!--bindings={
"ng-reflect-ng-if": "false"
}--><!--bindings={
"ng-reflect-ng-if": "Wed 25 de Abril 2018 , 17:58 P"
}--><div class="datetime-text">Wed 25 de Abril 2018 , 17:58 PM</div><button aria-haspopup="true" class="item-cover item-cover-ios item-cover-default item-cover-default-ios" ion-button="item-cover" type="button" id="undefined" aria-disabled="false"><span class="button-inner"></span><div class="button-effect"></div></button></ion-datetime>
Error 1
TypeError: Can not read property 'year' of null at DateTime.calcMinMax ( link ) at DateTime.generate ( link ) at DateTime.open ( link ) at DateTime._click ( link ) at Object.eval [as handleEvent] (ng: ///AppModule/PedidosPage.ngfactory.js: 80: 51) at handleEvent ( link ) at callWithDebugContext ( link ) at Object.debugHandleEvent [as handleEvent] ( link ) at dispatchEvent ( link ) at link
In this case, the format that returns me returns to the property min (new Date()).toLocaleString()
18/4/2018 10:12:26
Case 2: In the second case I pass the format that returns new Date().toJSON()
2018-04-18T15: 21: 25.380Z and when I click on it, it does not bother me, but when I place it on the minimum day 2018-04-18 , the hours are disabled and it does not allow me to select a time in the component, the logic would be that it would allow me to select a time greater than 15: 21: 25.380
<ion-datetime class="ocultar datetime datetime-ios ng-pristine ng-valid ng-touched" displayformat="DDD DD de MMMM YYYY , hh:mm A" max="2050" ng-reflect-min="2018-04-18T15:21:25.380Z" ng-reflect-max="2050" ng-reflect-display-format="DDD DD de MMMM YYYY , hh:mm A" ng-reflect-model="2018-04-25T17:58" id="date1"><!--bindings={
"ng-reflect-ng-if": "false"
}--><!--bindings={
"ng-reflect-ng-if": "Wed 25 de Abril 2018 , 17:58 P"
}--><div class="datetime-text">Wed 25 de Abril 2018 , 17:58 PM</div><button aria-haspopup="true" class="item-cover item-cover-ios item-cover-default item-cover-default-ios" ion-button="item-cover" type="button" id="undefined" aria-disabled="false"><span class="button-inner"></span><div class="button-effect"></div></button></ion-datetime>
This error only happens if I use the displayformat="DDD DD de MMMM YYYY , hh:mm A"
but if I use displayformat="DDD DD de MMMM YYYY , HH:mm A"
everything works perfectly, but I do not want to work with the 24 hour format, how do I correct any of the two cases?