aspnetmvc-401882-components-gantt-work-time-rules.md
The Gantt extension allows you to specify work days, work hours, and holidays.
Run Demo: MVCxGantt - Work Time Schedule
To set up work time rules, populate the WorkTimeRules collection with the following objects:
The following table lists common rule settings:
|
Property
|
Description
| | --- | --- | |
|
Specifies whether a day is a work day.
| |
Recurrence
|
Contains recurrence settings that depend on the rule type.
| |
|
Contains settings for work time ranges.
|
The Daily class contains settings for a daily recurrence pattern.
|
Property
|
Description
| | --- | --- | |
|
Start date.
| |
|
End date.
| |
|
Number of occurrences.
| |
|
Interval between adjacent occurrences, in days.
|
Work time patterns:
In March of 2019, a work day is from 8:00 AM to 5:00 PM - with an hour break from noon to 1:00 PM.
In March of 2019, every third day is a work day - with a work shift from 10:00 AM to 10:00 PM.
The Weekly class contains settings for a weekly recurrence pattern.
|
Property
|
Description
| | --- | --- | |
|
Day of the week.
| |
|
Start date.
| |
|
End date.
| |
|
Number of occurrences.
| |
|
Interval between adjacent occurrences, in weeks.
|
Work time patterns:
Fridays, Saturdays, and Sundays are non-working days.
Monday to Wednesday – work days from 8:00 AM to 2:00 PM; Thursday to Friday – work days from 2:00 PM to 8:00 PM; Saturday and Sunday – non-work days.
The Monthly class contains settings for a monthly recurrence pattern.
|
Property
|
Description
| | --- | --- | |
|
Specifies whether the Gantt chart applies the rule to a day of the week (DayOfWeekOccurrence, DayOfWeek) or a specific day (Day).
| |
|
Day.
| |
|
Designates an occurrence interval for a specific day of the week.
| |
|
Day of the week.
| |
|
Start date.
| |
|
End date.
| |
|
Number of occurrences.
| |
|
Interval between adjacent occurrences, in months.
|
Work time patterns:
Every second Friday in a month has a different work time.
Every 10th of the month is a non-work day (for three months).
The Yearly class contains settings for a yearly recurrence pattern.
|
Property
|
Description
| | --- | --- | |
|
Specifies whether the Gantt chart applies the rule to a day of the week (DayOfWeekOccurrence, DayOfWeek) or a specific day (Day, Month)
| |
|
Day.
| |
|
Month.
| |
|
Designates an occurrence interval for a specific day of the week.
| |
|
Day of the week.
| |
|
Start date.
| |
|
End date.
| |
|
Number of occurrences.
| |
|
Interval between adjacent occurrences, in years.
|
Work time patterns:
2-week holidays.
The work day before a holiday is shortened by one hour.