mergeCalendars

merges several working calendars into one

void mergeCalendars(array calendars);

Parameters

calendarsarrayan array of calendars' objects

Example

const johnCalendarId = gantt.addCalendar({
    worktime: {
        hours: ["0:00-24:00"],
        days: [0, 1, 1, 1, 1, 1, 0]
    }
});
const mikeCalendarId = gantt.addCalendar({
    worktime: {
        hours: ["8:00-12:00", "13:00-17:00"],
        days: [0, 1, 1, 1, 1, 1, 0]
    }
});
 
// pass an array of calendars as an argument
const joinedCalendar = gantt.mergeCalendars([
gantt.getResourceCalendar(mikeCalendarId),
gantt.getResourceCalendar(johnCalendarId)
])

Details

You can also specify a set of objects of calendars as parameters of the mergeCalendars method:

// pass calendars as arguments 
const joinedCalendar = gantt.mergeCalendars(
    gantt.getCalendar(mikeCalendarId),
    gantt.getCalendar(johnCalendarId)
);
See also
Change log

added in v7.0

Back to top