longbill / jquery-date-range-picker

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

Reselect EndDate #292

Open ChristopherSchaefer opened 7 years ago

ChristopherSchaefer commented 7 years ago

I want to reselect the enddate when the date-range is still selected. How can I do this? I only want to change the "Bis"(to)-date.

478_25-10_1320

damiangelis commented 6 years ago

You can get an acceptable functionality by writing the following:

$("#datum-biss").on("click", function() {

    setTimeout(function () {
        $(".first-date-selected").click();
    }, 16);

});

When the calendar is opened, first selected date is clicked programmatically so you can reselect just the end date.

Tip: Set selectForward: true for a nicer experience.

wakirin commented 6 years ago

just for information (I see topic is old)

I have added as option, see demo Re-select option https://wakirin.github.io/jquery-date-range-picker/

update available on npm npm i @waki/jquery-date-range-picker