Premium support for our pure JavaScript UI components


Post by baseev »

Hello,

We have an issue where the lag calculation is using the project calendar, but we want it to use the predecessor activity's calendar instead. The schedule we imported from P6 uses the predecessor activity's calendar. Is there a way to achieve the same behavior?

Thanks,
Baseev

Attachments
Screenshot 2025-04-16 at 10.11.06 AM.png
Screenshot 2025-04-16 at 10.11.06 AM.png (448.96 KiB) Viewed 286 times

Post by arcady »

Hello,

A calendar to be used for dependency lags/leads is specified on the project level:
https://bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#field-dependenciesCalendar

As far as I understand you want it to be changed for a particular task. Correct?

It's feasible but will require overriding DependencyModel class calculateCalendar method:

class Dependency extends DependencyModel {

    * calculateCalendar(...args) {
        const proposedValue = yield ProposedValueOf(this.$.calendar);

        // If have a value assigned to the dependency.calendar field
        // - use it
        if (proposedValue) {
            // if that's a calendar use it as is
            return proposedValue.isCalendarModel ? proposedValue
                // if not that must be a calendar identifier - find it in the calendar manager store
                : this.getCalendarManagerStore()?.getById(proposedValue);
        }

        // otherwise fallback to the default logic
        return yield* super.calculateCalendar(...args);
    }

}

const gantt = new Gantt({
    project : {
        dependencyModelClass     : Dependency,

The method is not documented so TypeScript won't be aware of its existence.
I've made a ticket to support that behavior out of the box: https://github.com/bryntum/support/issues/11142

Best regards,
Arcady


Post by arcady »

P.S. Also if you spot some differences between P6 and the Gantt data you could provide us with a sample *.xer file (a small one ideally to not investigate a few thousand of tasks :) ) reproducing the issue.


Post by baseev »

Hello Arcady,

Sorry, I'm no able to attach the .xer file on the forum. Attached the error message.

Thanks,
Baseev

Attachments
Screenshot 2025-04-17 at 11.53.47 AM.png
Screenshot 2025-04-17 at 11.53.47 AM.png (116.27 KiB) Viewed 218 times

Post by arcady »

Hello,

And what if you the file to a zip-archive?

Best regards,
Arcady


Post by baseev »

Hi Arcady,

It works! Attached the .zip file

Regards,
Baseev

Attachments
abc.xer.zip
(5.44 KiB) Downloaded 22 times

Post by arcady »

Hello,

Ok there is a config we should import from Primavera scheduling options to support it properly.
Here is a ticket for this: https://github.com/bryntum/support/issues/11231

Thank you for the report! We'll try to address it soon.

Best regards,
Arcady


Post by arcady »

Hello,

I've updated our https://bryntum.com/products/gantt/examples/msprojectimport/ demo to better import Primavera files.
It's not yet deployed. please check after the next v6.2.2 release (or you can get the fixed version in the next nightly build in the customerzone).

Basically I've added importing of the dependenciesCalendar config I mentioned above.
Plus there was a bug in importing calendar exceptions (Primavera provides them in a bit different way comparing to MS Project so I had to adjust the code a bit).

Please let us know if it works for you when checked!

Best regards,
Arcady


Post Reply