I use ng-bootstrap Datepicker something like here: plnkr example
<div class="input-group">
<input class="form-control" placeholder="yyyy-mm-dd"
name="dp" [(ngModel)]="model" ngbDatepicker #d="ngbDatepicker">
<div class="input-group-addon" (click)="d.toggle()" >
<img src="img/calendar-icon.svg" style="width: 1.2rem; height: 1rem; cursor: pointer;"/>
</div>
</div>
and I would like have placeholder as current date instead yyyy-mm-dd. For example today 23.10.2016. It is possible or how can i do that.
You can do like this-
In component, defined date like this-
valuedate = new Date();
In template html, change placeholder like this-
placeholder="{{valuedate | date: 'yyyy-MM-dd'}}"
Result:
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