我使用日期模式来bsDatepicker并正常工作。<input type="text" class="form-control" formControlName="birthday" bsDatepicker[bsConfig]="bsConfig" [(bsValue)]="birthday" value="{{dataNascimento | date:'dd/MM/yyyy - dd/MM/yyyy' }}" />
但是在bsDaterangepicker中不起作用<input class="form-control" #drp="bsDaterangepicker" bsDaterangepicker [bsConfig]="bsConfig"[maxDate]="bsConfig.maxDate" value="{{periodo | date:'dd/MM/yyyy - dd/MM/yyyy' }}" />
错误消息ERROR Error: InvalidPipeArgument: 'Wed Nov 22 2017 12:50:19 GMT-0200 (Horário brasileiro de verão),Wed Nov 22 2017 12:50:19 GMT-0200 (Horário brasileiro de verão)' for pipe 'DatePipe'
ngx-bootstrap,Angular和Bootstrap的版本:
ngx-bootstrap:2.0.0-beta.8
角度:5.0.0
引导程序:3.3.7
构建系统:Angular CLI 1.5.2
题
谁将日期模式定义为Daterangepicker?
最佳答案
是的,因为它们在范围内具有rangeInputFormat
属性,且具有您的格式,即rangeInputFormat: 'DD-MM-YYY'
https://valor-software.com/ngx-bootstrap/#/datepicker#bs-datepicker-config