More Related Content
Similar to date2.docx (20)
More from Rohit Singh (15)
date2.docx
- 1. date2
formdate() {
this.fromDate = new Date(this.calender.formdate)
this.fromDate = this.fromDate.getTime()
//console.log( this.fromDate)
}
todate() {
this.twoDate = new Date(this.calender.todate)
this.twoDate = this.twoDate.getTime()
}
ngOnInit() {
var today = new Date();
var minAge = 0;
this.minAge = new Date(today.getFullYear() - minAge, today.getMonth(),
today.getDate());
}
calender: any = { todate: '', formdate: '' }
fromDate: any = '';
minAge: Date;
twoDate: any = '';
<div class="head_flt_select">
<div class="head_flt_select input-label">
<span class="d-flex align-items-center">From</span>
<input type="date" max="{{minAge | date:'yyyy-MM-dd'}}"
name="formdate" [(ngModel)]="calender.formdate" (change)="formdate()"
class="form-control datepicker" placeholder="Search by
date">
</div>
</div>
<div class="head_flt_select">
<div class="head_flt_select input-label">
<span class="d-flex align-items-center">To</span>
<input type="date" name="todate" min="{{fromDate | date:'yyyy-
MM-dd'}}" [disabled]="!calender.formdate" (change)="todate()"
[(ngModel)]="calender.todate" class="form-control datepicker"
placeholder="Search by date">
</div>
</div>
- 2. reset() {
this.twoDate = '';
this.fromDate = '';
this.calender.todate = '';
this.calender.formdate = '';
this.searchobj.usersearch = '';
this.statuseR = ''
this.status = '';
// this.formdate()
// this.todate()
console.log(this.fromDate)
console.log(this.twoDate)
this.getUserList(this.p);
}