'How to change horizontal size of Angular Material datepicker?
This is the datepicker that I want to set my custom horizontal size: https://material.angularjs.org/1.0.5/demo/datepicker
Solution 1:[1]
Not sure if this is what you mean but to set the horizontal size of the input of the date picker you can override css class as follow
.md-datepicker-input-container {
width: 300px;
}
Solution 2:[2]
This works for me in Angular Material 6
.mat-datepicker-content .mat-calendar
{
zoom: 0.85;
}
Solution 3:[3]
I was able to solve this by setting the display to block on the mat-form-field
. I have other form controls which I'm trying to have matching width's so this solution worked for me. Might work for someone else.
In HTML:
<mat-form-field class="display-block">
<...date picker and other form elements...>
</mat-form-field>
In css:
.mat-form-field.display-block {
display: block;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | j3ff |
Solution 2 | kanagaraj palanisamy |
Solution 3 | user |