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.

Datepicker: multiple months out of viewport

See original GitHub issue

Bug description:

Cannot make it work well in a grid system, so for example if i have 1 row and every datepicker is a col-md-4 and I set displayMonths to 6. my idea was that there where blocks like: x. x. x.
x. x. x.

<ngb-datepicker [startDate]="startDate" [(ngModel)]="dateModel" [displayMonths]="3" ngbDatepicker [navigation]="'none'" [dayTemplate]="customDay"
        [markDisabled]="isDisabled" #dpDate="ngbDatepicker" class="datepicker mb-3" (ngModelChange)="onChange($event)"></ngb-datepicker>

Now when i put 6 datepicker’s they are just in 1 line totally out of the viewport! It doesn’t matter if there is a row arround it or a container or something similar.

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 2.3.5

ng-bootstrap: 20

Bootstrap: 6

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
OzymandiasTheGreatcommented, Feb 7, 2020

This is neither a duplicate nor is it fixed. The other issue is about wrong placement of the popup. This issue is about ngb-datepicker with displayMonths set to say 8 makes the months go off screen. The widget simply isn’t styled sufficiently. For anyone having this issue add this to your component styles:

:host ::ng-deep .ngb-dp-months {
     flex-flow: row wrap;
     justify-content: flex-start;
}
:host ::ng-deep .ngb-dp-month {
     flex: 1 0 auto;
}

I think this should be the default style, maybe with modifications.

Please reopen this issue 😃

P.S. I can make a pull request if you think this is a reasonable default.

0reactions
rickithadicommented, Sep 13, 2019

any progress on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jquery Datepicker: Show multiple months (custom number) in ...
I am trying to display calendar using jquery datepicker with specified date range. In one of the case, I would like to display...
Read more >
Presenting a date picker (calendar) that span multiple months
The system I am working on allows users to post events and find events they wish to go to. Currently, events are very...
Read more >
JQuery and JQuery Mobile Calendar Multi month view Example
JQuery multi-month calendar. Always or dynamically show one, two or three months side by side depending on screen size. For jQuery or jQuery...
Read more >
Options — bootstrap-datepicker documentation - Read the Docs
Enable multidate picking. Each date in month view acts as a toggle button, keeping track of which dates the user has selected in...
Read more >
Date Picker Dialog Example | APG | WAI - W3C
Modal Dialog Example: An example demonstrating multiple layers of modal ... the month and year is marked up as a live region so...
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