1
I have a date type input, and I need it not possible to select date that is not from today back, I tried that way, but I did not have much success:
HTML:
<input [(ngModel)]="atv.dataini" type="date" class="form-control" #one min="{{this.today}}">
TYPESCRIPT:
today = this.dNow.getFullYear() + '-0' + (this.dNow.getMonth() + 1) + '-0' + this.dNow.getDate();
also tried that way:
HTML:
<input [(ngModel)]="atv.dataini" type="date" class="form-control" #one min="{{this.tdNow}}">
TYPESCRIPT:
dNow = this.formatDate(new Date());
formatDate(date) {
let result = date.split('-').reverse().join('/');
return result
}