angular - material design Angular2 dateformat not working dd/mm/yyyy -


i using angular2 material-design datepicker when select date throws error "the specified value not conform required standard
"yyyy-mm-dd". have tried amend locale no avail.

html

  <div>   <md-input-container>   <input mdinput [mddatepicker]="picker" placeholder="date"    formcontrolname="dateofpurchase" ngdefaultcontrol    [formcontrol]="dtpurchase" [(ngmodel)]="dateofpurchase" required    type="date" name="dateofpurchase" id="dateofpurchase">   <button mdsuffix [mddatepickertoggle]="picker"></button>  </md-input-container>  <md-datepicker #picker></md-datepicker>    </div> 

typescript

import { dateadapter } '@angular/material';  constructor(private dateadapter: dateadapter<date>) {     this.dateadapter.setlocale('gb');     this.dtpurchase= new formcontrol(); } 

any appreciated.

@nehal

your suggestion on example works error still persists - see pic below

datetimepicker error


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -