Open asterzwx opened 8 years ago
Current version supports just simple use-cases, your one is planned for next major release.
As a workaround, you can add a validator that validates the time. ion-datetime-picker
runs ng-model
under the hood so everything you would use with <input>
applies there as well.
Hi thanks for your reply. Currently I'm using ion-datetime-picker
instead of input
, so will I still be able to proceed with my use case? If so, do I just validate the time from the controller itself?
I would also need to set the min Hour and max Hour, can I do that in the controller?
ion-datetime-picker
and <input type="date/time/datetime-local">
should be equal from the controller's point of view. You can either make up the validator in the controller itself or use a custom ng-model
validator if you are already using build-in form validations.
I see. By the way, I need to modify the hour (as shown in attached photo), and I can only do so in ion-datetime-picker.min.js using e.hour
. How will I be able to access this from the controller? Much thanks.
You can change the model value itself to do this.
Alright I'll try doing that. Thank you :)
Oh yes, sorry one more thing, are we able to let the hour and minute boxes in the popup to be non-editable? Update: I managed to do that using ng-readonly="true".
Of course not, if you want to set date only, use date
picker without the time part. But if you are ok with changing the plugin, feel free to tailor it to your needs :)
Alright thanks again :+1:
I set the time value $rootScope.startTimeValue = 0;
and it's look like '08:00',but when i click this item,input change the time becomes the current time '10:14',How to modify the default time of input? thanks :+1:
Hi Wang, it seems like you are in a wrong issue. Your problem is discussed in #19 and #2. If you are still unable to make it work, feel free to open new issue with a codepen/plnkr/jsbin demonstrating the problem.
Able to let user select only the hours in the Day? for example, they can only choose from 0900 - 2100 (9AM - 9PM), so hours from 2200 - 0800 is not allowed. Do I need to change anything in the plugin file? Thank you.