Help with DateTangePicker in jQuery

1

I'm using the jQuery Date Range Picker on a form. Follow the code in jsfiddle

My problem is when I click on the input Input appears the date range picker normally, but when I click on the input date, I need it to close and open on the output of the output. The way it is I select the date of entry and exit by input input.

Does anyone know how I can resolve this?

    
asked by anonymous 05.06.2017 / 23:03

1 answer

1

I have not delved into the events the datepicker itself makes available, perhaps it has some more "correct" way of doing this. I simply detect the click on the datepicker, if after the click the start date is filled, repositions the datepicker below the input of the end date.

$(".date-picker-wrapper").click(function(){
    if($(this).find(".start-day").html().length > 4){
        $(this).css('left',$("#datasaida").offset().left);
  }
});

Here's a code fiddle: jsFiddle

* Note that when resizing the page, the start position is restored, to handle this with resize ()

    
05.06.2017 / 23:28