How to modify an existing diary

I have a request that when I create a new calendar, I add the id to the new calendar, but I want to do other time processing on the calendar, for example, add .the working hours of the week, etc

Hello,
You need to call the setWorkTime method from the calendar object to change its work time settings:
https://docs.dhtmlx.com/gantt/api__gantt_calendar_other.html
Here are examples:
https://snippet.dhtmlx.com/6vph6heu:
https://snippet.dhtmlx.com/11kkdcqw