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

calling dayClick clears all selected days #17

Open
barrct opened this issue Apr 16, 2019 · 3 comments
Open

calling dayClick clears all selected days #17

barrct opened this issue Apr 16, 2019 · 3 comments

Comments

@barrct
Copy link

barrct commented Apr 16, 2019

If I need an action to happen when a data is selected, confirmation, added detail, or to update a second instance's blackout dates, as soon as I add the function for [dayClick] it clears out all days on the calendar.

Now, if this is expected, I would say it's weird but I suspect that it should not wipe out all data. The below tweaks seems to allow the calendar to function in the way that I expected the [dayClick] trigger to work.

    if (typeof this.dayClick == 'function') {
        this.dayClick(event, day);
        /*
        if (!day.mdp.selected) {
            this.projectScope = [day.date];
            this.generate();
            this.dayClick(event, day);
        }
        else {
            this.clearDays();
            this.dayClick(event, day);
        }
        */
    }
@xtianus79
Copy link
Owner

isn't the dayclick to just use a single day instead of multiple days?

@barrct
Copy link
Author

barrct commented Oct 21, 2020

Sorry, been on other projects.
Isn't dayClick to use a single day?
I'm not reading the parameter that way, I read the parameter as "when a DAY is CLICKED, notify some process" especially when the module is "multiple-date-picker".
Examples:

  • When a day is clicked, mark a form dirty so the user knows they can save the form.
  • Build a list of selected dates to assign people to in a list below
  • Black out days on another calendar (Maybe this is a "company closed" calendar and the office calendars are lower). My specific use case is marketing where I have one calendar for the "cutoff" dates to get material in and a second calendar that is the "publish" dates. The dates on one calendar define what is disabled on the other.

@barrct
Copy link
Author

barrct commented Oct 21, 2020

btw, the above edit to allow the dayClick action to fire while maintaining the "multiple" aspect of the module is in
/dist/multiple-date-picker.component.js
line 121 of version 3.0.0

It is within the MultipleDatePickerComponent.prototype.toggleDay function

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

No branches or pull requests

2 participants