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

Deactivate two days, and for hours #284

Open
cescteruel92 opened this issue Jan 28, 2019 · 2 comments
Open

Deactivate two days, and for hours #284

cescteruel92 opened this issue Jan 28, 2019 · 2 comments

Comments

@cescteruel92
Copy link

Hello, is it possible to block the weekend (Saturday and Sunday), with the "selectable" function? Would it be possible to block in number and not in text? (monday = 1, sunday = 7 ...)

Would it also be possible to block hours? for example from 00:00 to 09:00 and from 18:00 to 00:00 (18:00 - 09:00)

Thank you

@cescteruel92
Copy link
Author

To deactivate Saturday and Sunday, and to work in all languages, I have done it in the following way:

ctrl.isSelectable = function (date) {
      return date.format('d') == 1 || date.format('d') == 2 || date.format('d') == 3 || date.format('d') == 4 || date.format('d') == 5;
};

That is to say, I have enabled the days of 1-6 (Monday to Friday)

Now I would disable the hours (from 18:00 to 09:00).

@cescteruel92
Copy link
Author

In the complete script, I found the function of the hours, the only thing I have done is to define the minimum time (default 0, with the maximum time 23)

// Day View hoursFormat: 'HH:[00]', hoursStart: 9, hoursEnd: 18,

Now I just need, disable the 14 that is the lunch break.

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

1 participant