ngx-bootstrap: bsDaterangepicker doesn't work with minMode 'month'

Clicking in left datepicker do nothing but clicking in right datepicker somehow increase year.

<input type="text" bsDaterangepicker [bsConfig]="{minMode: 'month'}">

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 3.1.4

Angular: 7.1.4

Bootstrap: 4.1.3

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 15

Most upvoted comments

In my context, I’d like to select a range of months or a range of years. minMonth makes calendar render properly.

But the click events on the months does not select the range (as it does with minMonth='day'

I am creating a birth date picker and realized that it is much easier to select year, then switch view to month, and then to day. This way the user can select date of birth in just 3 clicks.

But when starting view mode in ‘year’ bsDatePicker refuse to switch date to the selected year. When switching to month view, the title should reflect the year selected, but it doesn’t. It picks a certain year and refuse to change to the year picked by the user. The same happens when picking the month.

So I made a very ugly workaround by making each select handler set the date and change view mode to the next step, then opening the calendar again. Hopefully the close/open will be too quick for the user to notice.

Well, code says more than a thousand words. This is my hack: Stackblitz: ngx datepicker year->month->day workaround