Calendar Element
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A calendar is used to define standard working and nonworking times in Microsoft Office Project. A project must have one base calendar. Tasks and resources may have their own calendars, which are based on a base calendar.
<Calendar>
ComplexTypeValue
</Calendar>
Parent Elements
Child Elements
Element |
Required/Optional |
Description |
---|---|---|
Required |
The unique ID for the calendar. |
|
Optional |
The name of the calendar. |
|
Optional |
Indicates whether the calendar is a base calendar. |
|
Optional |
The unique ID for the base calendar on which this calendar depends; only used if this calendar is not a base calendar. |
|
Optional |
The type of working day (a day of the week, or exception). |
|
Optional |
New in Project 2007. Collection of exceptions associated with the calendar. |
|
Optional |
New in Project 2007. Collection of work week definitions. |
Occurrences
Minimum: 1 Maximum: Unbounded |
Example
The following example shows a local calendar named Team Base Calendar. The calendar is created as a new base calendar, not as a copy of another calendar.
Caution |
---|
In the releases of Project 2007 through SP1, the WorkWeeks element name is missing when you save a project that has a non-default work week as XML. If you try to open the XML file in Project, you get an error, "An unexpected problem occurred while opening the file. The file may be damaged." The workaround is to edit the XML file and add the WorkWeeks element name, as in the following example. The XML file then opens normally. However, because the WorkWeek element contains other errors, we recommend that you do not use Project XML files to save work week data until the errors are fixed in a later service pack. For more information about editing other elements for work weeks, see the WorkWeek Element. |
<Calendar>
<UID>5</UID>
<Name>Team Base Calendar</Name>
<IsBaseCalendar>1</IsBaseCalendar>
<BaseCalendarUID>-1</BaseCalendarUID>
<WeekDays>
<WeekDay>
<DayType>1</DayType>
<DayWorking>0</DayWorking>
</WeekDay>
<WeekDay>
<DayType>2</DayType>
<DayWorking>1</DayWorking>
<WorkingTimes>
<WorkingTime>
<FromTime>08:00:00</FromTime>
<ToTime>12:00:00</ToTime>
</WorkingTime>
<WorkingTime>
<FromTime>13:00:00</FromTime>
<ToTime>17:00:00</ToTime>
</WorkingTime>
</WorkingTimes>
</WeekDay>
. . .
</WeekDays>
<Exceptions>
<Exception>
<EnteredByOccurrences>0</EnteredByOccurrences>
<TimePeriod>
<FromDate>2007-11-22T00:00:00</FromDate>
<ToDate>2007-11-23T23:59:00</ToDate>
</TimePeriod>
<Occurrences>2</Occurrences>
<Name>Thanksgiving holidays</Name>
<Type>1</Type>
<DayWorking>0</DayWorking>
</Exception>
</Exceptions>
<WorkWeeks>
<WorkWeek>
<TimePeriod>
<FromDate>2007-11-26T00:00:00</FromDate>
<ToDate>2007-11-26T23:59:00</ToDate>
</TimePeriod>
<Name>Post-holiday working days</Name>
</WorkWeek>
</WorkWeeks>
</Calendar>