import { Component } from '@angular/core'; import { BsDatepickerConfig } from 'ngx-bootstrap/datepicker';
@Component({
selector: 'app-datepicker',
templateUrl: './datepicker.component.html',
styleUrls: ['./datepicker.component.css']
})
export class DatepickerComponent {
bsConfig: Partial
constructor() { this.bsConfig = Object.assign({}, { dateInputFormat: 'MM/YYYY', containerClass: 'theme-default' }); }
这样就可以在日期选择器中仅显示日期和月份了。
上一篇:Angular8-覆盖数组元素