mdehoog / Semantic-UI-Calendar

Calendar module for Semantic UI
MIT License
805 stars 127 forks source link

Date range problem #60

Open JoelTwilo opened 7 years ago

JoelTwilo commented 7 years ago

Hi, I'm having a problem with the calendar. I'm using it as a date range picker but if I select a date in the first calendar it doesn't block out the date in the second calendar.

How would I achieve this behavior?

Code is;

$checkin.calendar({
        type: 'date',
        endCalendar: $checkout,
        minDate: new Date(),
        formatter: {
            date: handler.dateFormatter
        },
        onChange: function(date, text){
            searchQuery.checkin = text;
        }
    });

    $checkout.calendar({
        type: 'date',
        startCalendar: $checkin,
        formatter: {
            date: handler.dateFormatter
        },
        onChange: function(date, text){
            searchQuery.checkout = text;
        }
    });
mdehoog commented 7 years ago

It looks like you're doing the right thing. Could you please provide an example JSBin that reproduces the issue?