mat-datepicker

How to add close button to customized mat-datepicker-header

北慕城南 提交于 2020-12-12 10:50:25
问题 I am using this UI component from the Angular material. https://material.angular.io/components/datepicker/overview#customizing-the-calendar-header I want to add close button the custom header but it seems not possible yet. At least I would like to get output event from the date picker header component. 回答1: As the MatDatepicker and MatCalendarHeader are two separate components, you will need to pass data between the components using an EventEmitter , or with BehaviourSubject through the use

How to add close button to customized mat-datepicker-header

最后都变了- 提交于 2020-12-12 10:50:05
问题 I am using this UI component from the Angular material. https://material.angular.io/components/datepicker/overview#customizing-the-calendar-header I want to add close button the custom header but it seems not possible yet. At least I would like to get output event from the date picker header component. 回答1: As the MatDatepicker and MatCalendarHeader are two separate components, you will need to pass data between the components using an EventEmitter , or with BehaviourSubject through the use

Angular Mat Calendar Disable date based on Rest result

感情迁移 提交于 2020-03-02 07:49:25
问题 I am using Angular material calendar (i.e) mat-calendar. I am trying to disable some of the dates in the calendar based on dynamics value. HTML <mat-calendar [headerComponent]="exampleHeader" [dateFilter]="filterDates"></mat-calendar> I am using a custom header, to catch next/previous month events and then call some rest api, and based on the result of this call, I want to disable some dates. Calls of this.nextClicked() and this.previousClicked(); are generated only after the rest api gave

It's possible Overwrite mat-monthly-view component on mat-datepicker to add week number column?

自作多情 提交于 2020-01-05 04:24:05
问题 I'm trying to add a week number column to the mat-monthly-view component used in the mat-datepicker component from angular material. I thought to extends the current mat-monthly-view and in some how tell to my module that when the mat-monthly-view are called substitute it by my extended one. But i do not find the way. have Angular support for this kind of solutions? UPDATED Module: providers: [ { provide: MatMonthView, useClass: MyMonthView}, ] componet: @Component({ selector: 'my-month-view'

Multiple Date Select in Material datePicker (Angular)

瘦欲@ 提交于 2020-01-03 05:15:12
问题 I have a requirement that a user can select multiple dates in a date picker. How can I implement multiple date select functionality in an Angular Material date picker? I tried this through dateClass . But, after every date selection the date picker will be closed. Here's what I tried HTML code: <input matInput [matDatepicker]="picker" placeholder="Choose a date"> <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle> <mat-datepicker [dateClass]="dateClass" #picker></mat