New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Date Range - Show current and previous month #5386
Comments
@ChaudhryAtif hey! What do you mean by
As I understood, you want to keep the current and prev month only if no daterange was selected, but, if I did that, then, it should show current month and next? Or what? |
@daniloff200 If it is already selected, then it should follow current functionality: It'll show the starting date of the range on left and next month on the right. |
@ChaudhryAtif okay, cool |
@daniloff200 Thank you for working on this! Edit/Update: I re-read your reply and I think I am saying the same thing below, so yes that is the desired behavior. Misunderstanding on my part! === Here's a rough example of expected outcome: https://stackblitz.com/edit/angular-mtluz4 Top picker is current behavior, bottom is desired feature (by a property, say showPreviousMonth="true") If you open the top picker, it shows current (Oct) and next (Nov) month. == If you select a range on the top picker, the start date will become the month on the left, and it'll show next month on the right. For example: 8/10 - 8/14 (Aug on left, Sep on right). 11/10 - 12/10 (Nov on left, Dec on right). If you select range on the bottom picker, it'll currently always show previous and current month (due to workaround/hack). What I meant by "also to only do this behavior when a range is not selected already." in my original post is that when the date range is selected, it should fall back to original functionality like the top picker. I hope this helps. Again, thanks for working on this! |
@ChaudhryAtif thanks for details and good example! Looks like my feature, works exactly the same, as in your demo! Hope it will be merged this week |
Perfect! Thank you for the effort! |
@daniloff200, it's been a while. Any update on this? |
@ChaudhryAtif |
@daniloff200 is there a way to avoid the current month moving to the left on date selection? I'd like to keep the previous month on the left at all times. Current behaviour: Assuming current month is October, When I open the date picker I see September and October. This is okay. When I select a date in October the view changes to October and November. Expected behaviour: I'd like to have an option to keep the initial months September and October after selecting a date in the current month |
@bunmiedee suppose you're talking about functionality described here : #5968 |
Ah yes! @daniloff200 this is exactly what I meant. Thanks for the update. Will keep an eye out for that |
is it possible to remove the second calendar, from the date range picker? |
Feature description or feature request:
Is it possible to show current and previous (instead of current and next) month in range picker if no range is selected?
Plunker/StackBlitz that reproduces the issue:
Here is a workaround found on SO, but I am wondering if there's a cleaner way to do it (or if it can be baked into the library), and also to only do this behavior when a range is not selected already.
Versions of ngx-bootstrap, Angular, and Bootstrap:
ngx-bootstrap: 5.1.1
Angular: 8.3.0
Bootstrap: 4.3.1
The text was updated successfully, but these errors were encountered: