I'm encountering an issue while trying to implement a time picker with a minimum and maximum hour range from 10:00 am to 10:00 pm. Unfortunately, I have discovered that I cannot achieve this using the ion-datetime component. Are there any alternative solutions available? You can view my demo code on Stackblitz.
HTML
<ion-item>
<ion-label>Date</ion-label>
<ion-datetime displayFormat="hh:mm A"
[(ngModel)]="myDate"
(ionChange)="setDate()" min="10:00" max="20:00"></ion-datetime>
</ion-item>
Component
myDate; minDate;maxDate;
datesArray = [];
constructor() {
this.minDate = '2020-08-28 10:00';
this.maxDate = '2020-08-28 20:00'
}
setDate() {
this.minDate = this.myDate;
this.datesArray.push(this.myDate);
}