how to disable past time from current time soo that user cant select the time which is over only select the time which is in future of type="time"

Viewed 21
<div class="date-time-para">
       <div class="box-date">
         <label class="font-weight-bold"> Select Date {{notificationDetails.scheduled_date}}</label>
            <!-- <input type="date" formControlName="notificationDate" placeholder="Select Date" class="input-sample" placeholder="Select Date" [(ngModel)]="notificationDetails.scheduled_date"> -->
            <input type="date" formControlName="notificationDate" [ngModel]="notificationDetails.scheduled_date | date:'yyyy-MM-dd'" [min]="currentDate" />
    
    </div>
   <div class="box-date">
      <label class="font-weight-bold">Select Time</label>
        <!-- <input type="tśme" formControlName="notificationTime" placeholder="Select Date" class="input-sample" placeholder="Select Date" [(ngModel)]="notificationDetails.scheduled_time"> -->
    <input type="time" formControlName="notificationTime" [ngModel]="notificationDetails.scheduled_time | date:'HH:MM'" [min]="currentDate " />
     </div>
   </div>

i want that in input type = "time" user can't able to select time which is passed when time popup opens and i have defined [min] = "currentTime" which is in .ts file in angular giving hour and minutes using date = new Date() in javascript

0 Answers
Related