Hi,
I can't find the proper way to change dependency lag duration unit, it always displayed in 'days'.
Can you tell me how to set it to 'hours'?
Gantt 2.1.9.
regards,
Norbi
The unit for lag comes from the dependency data. You can change it there; for example:
"dependencies" : {
"rows" : [
{
"id" : 1,
"fromTask" : 11,
"toTask" : 15,
"lag" : 2,
"lagUnit" : "h"
},
For more information on Gantt data consult please https://bryntum.com/docs/gantt/#guides/project_data.md
You can change the default by extending the DependencyModel
class as described here https://bryntum.com/docs/gantt/#Gantt/model/DependencyModel in section Subclassing the Dependency class.
If you would apply it to Gantt basic
demo, the beginning of app.js
file could look like this:
import DependencyModel from '../../lib/Gantt/model/DependencyModel.js';
class MyDependencyModel extends DependencyModel {
static get fields() {
return [{
name : 'lagUnit',
type : 'string',
defaultValue : 'h'
}];
}
}
const project = new ProjectModel({
dependencyModelClass : MyDependencyModel,
transport : {
load : {
url : '../_datasets/launch-saas.json'
}
}
});
new Gantt({
// ...