Skip to content

Small mechanism to flip end and last dates during selection#402

Open
michelollivier wants to merge 5 commits intomasterfrom
custom3
Open

Small mechanism to flip end and last dates during selection#402
michelollivier wants to merge 5 commits intomasterfrom
custom3

Conversation

@michelollivier
Copy link

Hi,

small mechanism to flip end and last dates during selection. Put this lines after block 'box.find('.day').each(function() {});' in dayHovering method:

var first_date_selected = box.find('.day.first-date-selected');
var last_date_selected = box.find('.day.last-date-selected');
var first_day_hovering = box.find('.day.hovering').first();

if ((first_date_selected.length ^ last_date_selected.length) && first_day_hovering.length) {

    var first_day_hovering_time = parseInt(first_day_hovering.attr('time'));

    if (first_date_selected.length) {

        var first_date_selected_time = parseInt(first_date_selected.attr('time'));

        if (first_day_hovering_time < first_date_selected_time) {

            first_date_selected.addClass('last-date-selected').removeClass('first-date-selected');

        }

    } else if (last_date_selected.length) {

        var last_date_selected_time = parseInt(last_date_selected.attr('time'));

        if (first_day_hovering_time > last_date_selected_time) {

            last_date_selected.addClass('first-date-selected').removeClass('last-date-selected');

        }

    }

}

Regards
Michel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants