I am using owl-date-time picker from angular 5. When I select today date from picker, it should not show past date and month.
Code:
<div class="form-group">
<label class="control-label col-sm-2 date-right-padding">Date</label>
<div class="col-sm-5 datePickerField no-left-padding">
<input [owlDateTime]="createTaskDatePicker" maxlength="19"
[disabled]="isDateEnabledCreateTask"
[(ngModel)]="createTask.activationDate" placeholder="dd/MM/yyyy hh:mm"
class="form-control owl-date-time-input" name="createTaskDate"
(click)="clearCreateTaskErrorMessages()">
<owl-date-time #createTaskDatePicker></owl-date-time>
</div>
<div class="col-sm-1 datePickerIcon">
</div>
</div>
Note:
Past date should be disable, when user select current date.
Question:
How to disable past date in owl-date-time picker.
Your suggestion helpful for me.
Add current date in component first:
public todayDate:any = new Date();
Then add below attribute to html input:
[min]="todayDate"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With