longbill / jquery-date-range-picker

A jQuery plugin that allows user to select a date range
MIT License
1.12k stars 579 forks source link

Issue with jquery-3.1.1 #332

Closed ARehmanMahi closed 2 years ago

ARehmanMahi commented 7 years ago

untitled

mijrs commented 7 years ago

What are your settings and what is your question?

ARehmanMahi commented 7 years ago

jquery 3.1.1

code:

$('#daterange').dateRangePicker(
{
    singleMonth: true,
    showShortcuts: false,
    showTopbar: false
});

As can be seen in attached image, There is empty space marked in red box.

I also noticed that customShortcuts doesn't work properly either, but that's a problem for another day.

ankurk91 commented 7 years ago

Can you try with jquery-migrate

https://code.jquery.com/jquery-migrate-1.4.1.min.js
jonathanarbely commented 7 years ago

Do you still have this problem @bsienn? I might be able to help.

ARehmanMahi commented 7 years ago

@jonathanarbely Thaks for reply,

I am using this plugin in my current projects and will on all my further projects because it's just so good. I have applied a simple fix for this on my project, But I can't seems to find it at the moment becuase the project have gone huge and my memory is not serving me well ATM.

But I'm pretty sure what I though it was doing and what I did it to behave. On single month it still showed next month as it does on double month. it occupies the space but doesn't render anything on 2nd month area. I simply had to force set its width to 0. Will see what I did in mycase and reply back later.

But what do you have in you mind care to share?

Here's a working jsfiddle of the issue

egmm commented 5 years ago

Hello!

I know this is aged, but it never came to closure.

I ran into this issue recently. The problem comes when you have singleMonth set to 'true' and you're working with date ranges rather than single dates, dateRangePicker keeps adding the 'time2' element which comes with a width of 190px (or something like that), causing the white space.

image

If you set 'singleDate' to true, the 'time2' element doesn't get added and the calendar looks good, but you can't select a range of dates.

Workaround: remove the 'time2' element:

$('.time2').remove();

Cheers!

devginie commented 5 years ago

Hi. I met also this problem.

I would be provide another solution. Could you insert "br" into between "div"s.

Following code:

html += '<div class="dp-clearfix"></div>' +
                '<div class="time">' +
                '<div class="time1"></div>';
            // >>>
            if (opt.singleMonth) {
                html += '<br>';
            }
            // <<<
            if (!opt.singleDate) {
                html += '<div class="time2"></div>';
            }

Have a nice day!