Hello,
I want to set Monday in time period A as a holiday and Tuesday in time period B as a holiday.
Then one of those days is a holiday
I found that after using customWeeks, setting a day within a separate time period as a holiday does not take effect. Why?
Specific steps are as follows
When I set the following code:
var calendarId = gantt.addCalendar({
id:“global”, // optional
worktime: {
hours: [“8:00-17:00”],
days: [ 1, 1, 1, 1, 1, 1 ,1],
customWeeks: {
winter: {
from: new Date(2018, 11, 1),// December 1st, 2018
to: new Date(2019, 2, 1),// March 1st 00:00, 2019,
hours: [“9:00-18:00”],
days: [ 1, 1, 1, 1, 0, 0, 0]
},
winter2: {
from: new Date(2018, 11, 10),// December 1st, 2018
to: new Date(2019, 2, 1),// March 1st 00:00, 2019,
hours: [“9:00-18:00”],
days: [ 0, 0, 0, 0, 1, 1, 1]
}
}
},
});
Then I set up the code and it doesn’t work.
Why?
Can’t you set additional dates after setting customWeeks?
let calendar = gantt.getCalendar(calendarId);
calendar.setWorkTime({
date: new Date(2018, 11, 10),
hours: false,
});