NgbDatepicker show months and years only

Noise A. picture Noise A. · May 30, 2017 · Viewed 9.2k times · Source

I am developing an app using Bootstrap 4 components, powered by Angular 4, and i have trouble configuring the NgbDatepicker directive to show only the months and years, not the days - like for credit cards.

I want to select only the month and year, i don't care about choosing a specific day.

My input looks like this:


<input id="demodate" type="text" name="demodate" ngbDatepicker
#startDateDp="ngbDatepicker" [(ngModel)]="modelDate"/>

I tried all the properties listed for the directive listed here

https://ng-bootstrap.github.io/#/components/datepicker

but none of them seem to help me. Any ideas?

Answer

BrunoJCM picture BrunoJCM · Feb 14, 2020

There is a request for that:

https://github.com/ng-bootstrap/ng-bootstrap/issues/1811

As of now (Feb/2020), this is not supported yet.