Search code examples
mpxj

ProjectFile.getDefaultCalendar is mismatch with ProjectProperties.getDefaultCalendarName


I am using MPXJ 7.8.1 to read MS Project File(.mpp). I changed the Project Calendar to "24 Hours" as following: enter image description here

ProjectProperties.getDefaultCalendarName returns the correct calendar name "24 Hours".

But the ProjectFile.getDefaultCalendar returns the incorrect calendar "Standard".

    ...
    UniversalProjectReader reader = new UniversalProjectReader()
    ProjectFile projectFile = reader.read(stream)
    ProjectProperties projectProperties = projectFile.getProjectProperties()
    "projectProperties.getDefaultCalendarName = " + projectProperties.getDefaultCalendarName() + ", projectFile.getDefaultCalendar = " + projectFile.getDefaultCalendar().getName()

Output: projectProperties.getDefaultCalendarName = 24 Hours, projectFile.getDefaultCalendar = Standard

Is there a way to get the correct calendar?


Solution

  • I've tried this locally with MPXJ 7.9.1 and the functionality seems to work as expected. If you are still having issues, can you open an issue on GitHub and attach an MPP file which demonstrates the problem - thanks!