The duration shows incorrect count
Support Forum
Here is the dataset
[ {
"id": 295,
"startDate": "2025-03-20T09:00:00",
"endDate": "2025-03-23T17:00:00",
"baselineStartDate": null,
"baselineEndDate": null,
"effort": 0.0,
"baselineEffort": 0.0,
"actualEffort": 0.0,
"effortUnit": "day",
"percentDone": 0.0,
"plannedToDate": 33,
"name": "3 days",
"projectMilestone": false,
"portfolioMilestone": false,
"markDeliverable": false,
"markActivity": false,
"rollup": false,
"manuallyScheduled": false,
"note": "",
"children": [],
"Custom_ACNT Activity": ""
}
]
Here is the configuration that might affect the incorrect duration
calendarSetting = {
Id: 74,
Name: "Project Calendars",
DaysPerMonth: 30,
DaysPerWeek: 7,
HoursPerDay: 24,
WeekendsAreWorkdays: true,
WeekendFirstDay: 6,
WeekendSecondDay: 0,
DefaultAvailability: ["00:00-24:00"],
};
new ProjectModel({
skipNonWorkingTimeInDurationWhenSchedulingManually: true,
})
Thank you
Hi,
I see calendarSettings
has wrong names for props (starts from upper case), as well as props which are not supported by calendar, such as daysPerMonth
, daysPerWeek
, hoursPerDay
, they are all configs of ProjectModel.
Please try to fix this and if you still experienced problem, apply required changes to our demo (for ex. http://lh/release/bryntum-suite/gantt/examples/advanced/) and share with us; link to demo, code, steps to reproduce
All the best,
Alex Lazarev
How to ask for help? Please read our Support Policy
We do not write the code in bounds of forum support. If you need help with development, contact us via bryntum.com/services
Hi,
additional info I found is that, when I put the recurrentStartDate and recurrentEndDate at these times 17:00 and 09:00 the duration it displays is wrong
{
"recurrentStartDate": "at 17:00",
"recurrentEndDate": "at 09:00",
"isWorking": False,
}
[{'isWorking': False, 'recurrentStartDate': 'on Saturday at 0:00', 'recurrentEndDate': 'on Sunday at 0:00'}, {'isWorking': False, 'recurrentStartDate': 'on Sunday at 0:00', 'recurrentEndDate': 'on Monday at 0:00'}, {'isWorking': False, 'recurrentStartDate': 'at 17:00', 'name': 'Monday', 'recurrentEndDate': 'at 09:00'}, {'isWorking': False, 'recurrentStartDate': 'at 17:00', 'name': 'Monday', 'recurrentEndDate': 'at 09:00'}]
The working day is from 9am to 5pm Monday to Friday or 9am to 5pm Monday to Sunday if the weekend is working day
I am not able to reproduce the issue in our advanced demo: https://bryntum.com/products/gantt/examples/advanced/. Please apply your configs there and share the steps with us.
One thing as Alex mentioned, you will have to apply the hoursPerDay config at the project level and not the calendar level. I have explained here how hoursPerDay config works and duration is being calculated with it: viewtopic.php?p=164665&sid=7db3af1598d59ee91df7c90445e6f556#p164665
Please review our demos, you can find them in sources you downloaded, in /examples folder. advanced demo has this code implemented.
"calendars" : {
"rows" : [
{
"id" : "general",
"name" : "General",
"intervals" : [
{
"recurrentStartDate" : "on Sat at 0:00",
"recurrentEndDate" : "on Mon at 0:00",
"isWorking" : false
}
],
"children" : [
{
"id" : "business",
"name" : "Business",
"intervals" : [
{
"recurrentStartDate" : "every weekday at 12:00",
"recurrentEndDate" : "every weekday at 13:00",
"isWorking" : false
},
{
"recurrentStartDate" : "every weekday at 17:00",
"recurrentEndDate" : "every weekday at 08:00",
"isWorking" : false
}
]
},
{
"id" : "night",
"name" : "Night shift",
"intervals" : [
{
"recurrentStartDate" : "every weekday at 6:00",
"recurrentEndDate" : "every weekday at 22:00",
"isWorking" : false
}
]
}
]
}
]
},
You can see "every weekday", that you can use for that.
All the best,
Alex Lazarev
How to ask for help? Please read our Support Policy
We do not write the code in bounds of forum support. If you need help with development, contact us via bryntum.com/services