ngx-daterangepicker-material icon indicating copy to clipboard operation
ngx-daterangepicker-material copied to clipboard

Previous month arrow disappears in right calendar

Open adam-drozdz-ie opened this issue 4 years ago • 4 comments

Hello, I'm having an issue with this calendar, which can be reproduced on demo page - https://fetrarij.github.io/ngx-daterangepicker-material/simple - Basic In-line Example. I would like to select date range February - March 2020.

When I open the example, the left calendar is on April and the right one is on May. I then change the left calendar to Februrary and would like to change the right one to March, but the arrow to switch to previous month disappears from the right calendar as soon as I switch to April. Which leaves me in a situation, where I'm unable to select any date range.

Any suggestions how to fix it?

Zrzut ekranu 2020-04-23 o 17 22 18

adam-drozdz-ie avatar Apr 23 '20 15:04 adam-drozdz-ie

The reason I'm asking about is that I wanted to use this component in my Angular application, however, I see no way to make it work the like I'd like it to, which is to be able to select any time period.

adam-drozdz-ie avatar Apr 24 '20 16:04 adam-drozdz-ie

Interesting scenario, but this seems to be by design. If you have a look at the project this adaptation is based on (https://www.daterangepicker.com/#examples scroll down to the part where you can customize the component and disable linkedCalendars feature), you'll see it also has this specific behaviour.

In the example you show above, the startDate is set to April 23, and the right panel has logic that prevents it from displaying dates before that selected start date. I'm not sure why it's configured like this: if the reason is that you don't want to be able to select a 'negative' date range, it's still really weird you can keep decreasing the left panel.

What's your suggestion on improving this scenario?

Timebutt avatar Apr 26 '20 10:04 Timebutt

@Timebutt

I would argue that selected date(s), should simply not limit right hand calendar view at all. Especially that currently left calendar is not limited, i.e. we can move it to further date than we had selected.

What, however might be worth to considerd is to limit calnedars between each other, i.e. left calendar should not move to further month then the right one and vice versa right should not move eariler then left one. Such behaviour probably should be solved by simply moving both earlier or further in case the meet the same month.

DonCziken avatar Apr 27 '20 14:04 DonCziken

Do we have update on this?

rakshabhartiya-gep avatar Jul 24 '20 17:07 rakshabhartiya-gep