How to set minimum and maximum time in ionic native date time picker.
I want the user to pick time only in between 10:00 am and 8:00 pm
I have been struggling with this task. Please help me…
Anyone ???
How to set minimum and maximum time in ionic native date time picker.
I want the user to pick time only in between 10:00 am and 8:00 pm
I have been struggling with this task. Please help me…
Anyone ???
Did you get the solution for this?
No… Did you ??
The plugin descriptions says:
minDate is a Date object for iOS and a millisecond precision unix timestamp for Android, so you need to account for that when using the plugin. Also, on Android, only the date is enforced (time is not).
I hope it helps.
For iOS:
new Date('2018-02-16T18:00:00')
For Android:
new Date('2018-02-16T18:00:00').value
i didnt understand . Can you please explain.
What i am looking for is that, i want the time picker to display only time between 10 am and 9 pm. All other times shouldnt be selectable.
I think it does only work for a special timestamp, like today between 10am and 9pm.
const now = new Date();
const nineAM = new Date(now.year, now.month, now.day, 8);
const tenPM = new Date(now.year, now.month, now.day, 21);
No I didn’t find any solution except converting it to the 24 hour format! No time conversion worked as well!
<ion-datetime displayFormat="h:a" mode="ios" hourValues="9,10,11,12,13,14,15,16"></ion-datetime>