Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

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