My requirement:
Show time picker within the range of 60 minutes.
(i.e) from now till next 60 minutes - user shall select a time.
Challenge / Problem :
In general it works fine, except one scenario.
If the user opens the time picker by 11:00 PM - the picker is not showing any value.
(i.e) as the maximum value for this case falls on the next day - the picker values are not showing properly.
Any help on this - would be really appreciable.
My html -
<ion-datetime picker-format=“HH:mm” [min]=“minTime” [max]=“maxTime” (ionFocus)=“setMinMaxTime()” >
js/ts file -
setMinMaxTime() {
this.minTime = (new Date(Date.now() - (new Date()).getTimezoneOffset() * 60000)).toISOString();
this.maxTime = (new Date((new Date(Date.now() - (new Date()).getTimezoneOffset() * 60000)).getTime() + 60 * 300 * 1000).toISOString());
}