Calendar
Overview
AnyGantt gives you an ability to configure days off and time off for any project, this settings doesn't affect projects themselves, but allow you to color holidays and weekends on timeplot. Illustration below pictures how AnyGantt shows days off on the time plot:

You can set what days of a week are days off, what hours are off, and create exception on given dates.
Calendar settings are applicable both to task and resource projects, thay are the part of timeline and don't depend on project type. Sample XML below shows calendar settings:
<timeline>
<calendar>
<week_days />
<exeptions />
</calendar>
</timeline>
</anygantt>
Enable time off display
By default time off coloring is turned off in AnyGantt. You need to enable it if you'd like to see holidays, weekends, nights, launch time and so on.
XML to enable time off coloring:
<timeline>
<plot>
<non_working_days show="true" />
<non_working_hours show="true" />
</plot>
</timeline>
</anygantt>
As you can see you can separately set how time off and days off are displayed. See time plot settings visualization tutorial to learn more.
Default Settings
By default Saturday and Sunday are days off, and there is no time off at all (24 hours work day). No exceptions or holidays are set.
See settings below, these are defaults hardcoded into AnyGantt:
<timeline>
<calendar>
<week_days>
<monday is_working="True">
<work from="00:00" to="24:00" />
</monday>
<tuesday is_working="True">
<work from="00:00" to="24:00" />
</tuesday>
<wednesday is_working="true">
<work from="00:00" to="24:00" />
</wednesday>
<thursday is_working="true">
<work from="00:00" to="24:00" />
</thursday>
<friday is_working="true">
<work from="00:00" to="24:00" />
</friday>
<saturday is_working="false" />
<sunday is_working="false" />
</week_days>
</calendar>
</timeline>
</anygantt>
Below you can find the deatiled description of these settings.
Days Off
By default Saturday and Sunday are days off, you can set any day of the week to be a day off. You should use <week_days> subnode of <calendar> node. <week_days> contains a node for every day of the week: <sunday>, <monday>, etc. Each os days node has is_working attribute that defines whether the day is off or not.
Lets imagine a "weekend party" project that has four working days: Thursday, Fryday, Saturday and Sunday. To create calendar like that set the following XML:
<timeline>
<calendar>
<week_days>
<monday is_working="false" />
<tuesday is_working="false" />
<wednesday is_working="false" />
<thursday is_working="true" />
<friday is_working="true" />
<saturday is_working="true" />
<sunday is_working="true" />
</week_days>
</calendar>
</timeline>
</anygantt>
Sample below shows such settings. Days off are colored in light red, and working days are not colored at all:
![]() |
Time off
Besides non working days you can also define the duration and schedule of each working day. By default calendar sets 24 hours working day, which is not usual.
Id the day is set to "is_working", you can define time off for this day. XML should be set as follows::
<timeline>
<calendar>
<week_days>
<monday is_working="True">
<work from="08:00" to="12:00" />
<work from="12:30" to="16:00" />
<work from="16:30" to="20:00" />
</monday>
</week_days>
</calendar>
</timeline>
</anygantt>
In the sample aboive Monday is a working day (is_working = "True"). And there are three <work> nodes in <monday> node, that set working time for this day. So, as set, on Mondays one should work from 8:00 till 12:00, from 12:30 till 16:00 and from 16:30 till 20:00, all other time spans will be shown on the time plot as non-working time.
Each day can have any number of worling periods. from attribute sets the start of the period, and to - the end of it. from time should preceed time set in to. Both of them are set in "hh:mm" format, where hh - hours from 0 to 23, and mm - munutes from 0 to 59.
Typical "real-world" calendar is shown in the sample below: Sunday is a day off, and a working day schedule from 9:00 till 13:00, then launch, then work from 14:00 till 19:00. Days off are colored in light red, time off in light green:
![]() |
Exceptions
If you wan't to define a holiday or custom day off you need exceptions - the override any day of week rules. If you want to define a custom schedule for a certain day - you need exceptions too.
Sample XML for the exception:
<timeline>
<calendar>
<exceptions>
<exception start_date="2008.07.02" end_date="2008.07.04" is_working="False" />
</exceptions>
</calendar>
</timeline>
</anygantt>
There is no limitations on the number of exceptions in the calendar:
<timeline>
<calendar>
<exceptions>
<exception start_date="2008.07.02" end_date="2008.07.03" is_working="False" />
<exception start_date="2008.07.07" end_date="2008.07.10" is_working="False" />
<exception start_date="2008.07.14" end_date="2008.07.18" is_working="False" />
<exception start_date="2008.08.03" end_date="2008.08.12" is_working="False" />
</exceptions>
</calendar>
</timeline>
</anygantt>
As you can see each exception is confugured in <exception>, node and it works from start_date till end_date. If only start_date is set, then exception lasts one day, is_working attribute defines whether day(s) is(are) off or working. определяет являеться ли день рабочим.
To define a custom day off set the following XML:
<timeline>
<calendar>
<exceptions>
<exception start_date="2008.07.02" end_date="2008.07.03" is_working="False" />
<exception start_date="2008.07.06" end_date="2008.07.06" is_working="False" />
<exception start_date="2008.07.09" end_date="2008.07.09" is_working="False" />
</exceptions>
</calendar>
</timeline>
</anygantt>
In this sample three exceptions are created, they set four days off. Samle below shows how these settings affect the chart:
![]() |
Exception that make one or several days the working days can also change the working time, it can be done just the very same way as working time for the week days.
XML below sets custom working hours for the custom date:
<timeline>
<calendar>
<exceptions>
<exception start_date="2008.07.02" end_date="2008.07.06" is_working="True">
<work from="08:00" to="12:00" />
<work from="12:30" to="16:00" />
<work from="16:30" to="20:00" />
</exception>
</exceptions>
</calendar>
</timeline>
</anygantt>
Live sample below changes working hours for the several days - 2008.07.04 to 2008.07.08, with working hours 08:00 to 16:00:
![]() |