Mahesh Mahesh - 3 months ago 21
Javascript Question

Start and end date being the same day of Zebra DatePicker

Is it possible to pair two date pickers but still allow selection of the same day.

$('#depart, #departc, #depart_modify').Zebra_DatePicker({
format: 'd/m/Y',
selectWeek: true,
inline: true,
pair: $('#return, #returnc'),
firstDay: 1
});

$('#return, #returnc, #depart_review').Zebra_DatePicker({
format: 'd/m/Y',
selectWeek: true,
direction: 0
});


but the end datepicker still disables selection of start and end date being the same day.

Answer

Try this

$('#depart, #departc, #depart_modify').Zebra_DatePicker({
    format: 'd/m/Y',
    selectWeek: true,
    inline: true,
    pair: $('#return, #returnc'),
    firstDay: 1,
    direction: true // add this line
});

$('#return, #returnc, #depart_review').Zebra_DatePicker({
    format: 'd/m/Y',
    selectWeek: true,
    direction: true // change 0 to true
});