Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

md-datepicker (Angular Material) should display only Month and Year in PopUP

How I can display only month and year using md-datepicker directive?

Currently, There is no information is available in Angular Material Documentation.

Can anyone help?

like image 780
Dishant Mehta Avatar asked Nov 16 '15 21:11

Dishant Mehta


People also ask

How do I change date format in picker?

In the Data type Format dialog box, do one of the following: To format the control to show the date only, select the display style that you want in the Display the date like this list. To format the control to show the time only, select the display style that you want in the Display the time like this list.

How disable all the dates before a particular date in angular?

Disable Past and Future Dates with min and max To disable past and future dates, we can use min and max properties in Datepicker input text with matInput attribute. If only past dates need to be disabled, configure only min property.


1 Answers

You can pass mode to the md-datepicker directive md-mode="month"

e.g

    <md-datepicker ng-model="dateFields.selectedDate"
                   md-mode="month">

enter image description here

like image 78
Ganesh Thorat Avatar answered Oct 10 '22 23:10

Ganesh Thorat