Resource assignments multiple date with different hours for day

hi I’m testing the gant and I haven’t found how to insert multiple dates with different times for each resource … I have read your documentation: https://docs.dhtmlx.com/gantt/desktop__resource_management.html

I saw this:

{
id: 5, text: “Interior office”, type: “task”, start_date: “03-04-2019 00:00”,
duration: 7, parent: “2”, progress: 0.6, priority: 1,
users: [{
resource_id: “3”,
value: 8,
delay: 1
},{
resource_id: “6”,
value: 3,
start_date: “03-04-2019 00:00”,
end_date: “05-04-2019 00:00”,
mode: “fixedDates”
},{
resource_id: “7”,
value: 3,
delay: 1,
duration: 2,
mode: “fixedDuration”
}
]
}

is possibile to create:
{
resource_id: “6”,
value: 3,
start_date: “03-04-2019 00:00”,
end_date: “04-04-2019 00:00”,
value: 5,
start_date: “04-04-2019 00:00”,
end_date: “05-04-2019 00:00”,
value: 2,
start_date: “05-04-2019 00:00”,
end_date: “06-04-2019 00:00”
}

Thanks :slight_smile:

Hello,
If I understood your question correctly, you want to use different modes of the resource assignment. Unfortunately, there is no built-in way to create mode selection. You can set the resource mode through the object of the resource assignment.

is possibile to create:
{
resource_id: “6”,
value: 3,
start_date: “03-04-2019 00:00”,
end_date: “04-04-2019 00:00”,
value: 5,
start_date: “04-04-2019 00:00”,
end_date: “05-04-2019 00:00”,
value: 2,
start_date: “05-04-2019 00:00”,
end_date: “06-04-2019 00:00”
}

You can’t use different dates for one resource object, because an object can’t have different properties with the same name - the most recently declared properties will overwrite the previous ones. To create the resource with multiple dates and different values you can use this example:

{
resource_id: "2",
value: 3,
start_date: "03-04-2019 00:00",
end_date: "04-04-2019 00:00",
},
{
resource_id: "2",
value: 5,
start_date: "04-04-2019 00:00",
end_date: "05-04-2019 00:00",
},
{
resource_id: "2",
value: 2,
start_date: "05-04-2019 00:00",
end_date: "06-04-2019 00:00"
}

Please check the following snippet: https://snippet.dhtmlx.com/qz8jh9ts