Ion-datetime angular- I want to display time in following range 7 AM – 10 PM

  angular, date, ionic-framework, time

I have a restriction in my Angular-Ionic app that user can not select time before 7 AM and after 12 PM so I want to show him time from 7AM to 10PM only but also want to show AM/PM options, the problem I am facing is that if user select 11 in hours and changes AM to PM than my condition is violated so how can user strictly restricted between 7am to 10pm that if user selects 11 in hours than he cant change am to pm.

Following is my code:
Start Time
<ion-datetime type="text" displayFormat="hh:mm a" minuteValues="0,15,30,45" min="07:00" max="22:00" [(ngModel)]="slot.startTime" name="start">

enter image description here

Source: Angular Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.