question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inline Datepicker with MatCalendar

See original GitHub issue

For some case is it helpfully to have the datepicker as inline calendar. But currently the datepicker is only available with on body tag, with a full page background layer for handle the close interaction.

Is it possible to inject the datepicker inline, or can this be a ne feature for the future? One solution is to use the “mat-calendar” component, but its might be not official and a little bit hacky.

Like: <mat-calendar #calendar [selected]="selDate" (selectedChange)="getChangedValue($event)"></mat-calendar> But its need to add more code in the *.ts file to update the view correctly. Like the changed value:

getChangedValue(newDate) { this.selDate = newDate this.calendar['_activeDate'] = newDate; this.calendar['monthView'] = false; // this line updates the calendar view

Any solution to use the code easier or to implement at the current state an inline datepicker?

Best regards, Stephan

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:61
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
windsound3482commented, Jun 5, 2020

I have seen such a question in https://stackoverflow.com/questions/57433084/is-there-a-way-to-show-mat-calendar-with-multi-month-view-using-angular-material. About how to make a multi-month View with mat-calendar. From other Apis, there is always a mode called flat mode. Is there also such a thing in Mat-calendar? After reading the code i have found nothing…

1reaction
ankushgoyal27commented, Feb 27, 2020

You can create your own header component by following the below example https://stackblitz.com/angular/kkrdobyvqpo?file=src%2Fapp%2Fdatepicker-custom-header-example.ts.

And rather than passing the header component in “[calendarHeaderComponent]=“exampleHeader”” use [headerComponent]=“exampleHeader” for mat-calendar.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 9|8|7 Material Inline MatCalender/ Datepicker Tutorial ...
Now to show Inline Datepicker Calender we will use mat-calendar component with following option properties: Input Properties: selected: Set ...
Read more >
How to implement ranged inline calendar with angular material?
When using mat-calendar, it is working for inline, but not for ranged. But if I pass selectedRangeValue as DateRange instead of Date, the...
Read more >
Datepicker - Angular Material
The datepicker allows users to enter a date either through text input, or by choosing a date from the calendar. It is made...
Read more >
Mat Datepicker Range Inline - StackBlitz
Starter project for Angular apps that exports to the Angular CLI.
Read more >
Angular Material Datepicker: Complete Guide
Complete guided tour to the Angular Material Datepicker component, ... a date directly inline in the page without typing it in manually.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found