我无法在ngx-bootstrap daterange选择器中隐藏星期数。 我试过的:
.html
<input type="text" #dp="bsDaterangepicker" (onHidden)="onPickerHide()" [isOpen]="showPicker" [(ngModel)]="dateRange" style="position: absolute;visibility: hidden;" placeholder="Daterangepicker" class="form-control" bsDaterangepicker [bsConfig]="dateRangePickerConfig">
app.component.ts
showPicker= true;
datePickerConfig: Partial<BsDatepickerConfig>;
this.datePickerConfig = Object.assign({},
{ showWeekNumbers: false,
dateInputFormat: 'DD-MM-YYYY'
}
);
我收到此控制台错误
答案 0 :(得分:11)
使用[bsConfig]="{ showWeekNumbers:false }"
我已在 Stackblitz Demo
上创建了一个演示<input
type="text"
#dp="bsDaterangepicker"
(onHidden)="onPickerHide()"
[(ngModel)]="dateRange"
style="position: absolute;"
bsDaterangepicker
[bsConfig]="{ showWeekNumbers:false }"
/>