Back to Devexpress

Work Time Rules

aspnet-400935-components-gantt-work-time-rules.md

latest5.8 KB
Original Source

Work Time Rules

  • Jun 07, 2022
  • 6 minutes to read

The Gantt control allows you to specify work days, work hours, and holidays.

Online Demo: ASPxGantt - Work Time Schedule

The Gantt stores its work time rules in the control’s WorkTimeRules collection. The following work time rules are available:

The following table lists common rule settings:

|

Property

|

Description

| | --- | --- | |

IsWorkDay

|

Specifies whether a day is a work day.

| |

Recurrence

|

Contains a rule’s recurrence settings. Each rule type contains an individual set of recurrence settings.

| |

WorkTimeRanges

|

Contains settings for work time ranges.

|

Daily Rule

The Daily class contains settings for a daily recurrence pattern.

|

Property

|

Description

| | --- | --- | |

Start

|

Specifies the daily recurrence’s start date.

| |

End

|

Specifies the daily recurrence’s end date.

| |

OccurrenceCount

|

Specifies how many times a daily rule occurs.

| |

Interval

|

Specifies the daily recurrence’s interval.

|

Work time patterns:

  • A work day is from 8 AM to 5 PM with an hour break (for a specified month).

  • Each third day is a work day with a work shift from 10 AM to 10 PM.

Weekly Rule

The Weekly class contains settings for a weekly recurrence pattern.

|

Property

|

Description

| | --- | --- | |

DayOfWeek

|

Specifies a day of the week to which the rule is applied.

| |

Start

|

Specifies the weekly recurrence’s start date.

| |

End

|

Specifies the weekly recurrence’s end date.

| |

OccurrenceCount

|

Specifies how many times a weekly rule occurs.

| |

Interval

|

Specifies the weekly recurrence’s interval.

|

Work time patterns:

  • Fridays, Saturdays, and Sundays are weekend days.

  • Monday to Wednesday – work days from 8 AM to 2 PM, Thursday to Friday – work days from 2 PM to 8 PM, Saturday and Sunday – weekend days.

Monthly

The Monthly class contains settings for a monthly recurrence pattern.

|

Property

|

Description

| | --- | --- | |

CalculateByDayOfWeek

|

Specifies whether the Gantt control calculates the rule by the day of the week.

| |

Day

|

Specifies a day.

| |

DayOfWeekOccurrence

|

Specifies a day of the week’s occurrence.

| |

DayOfWeek

|

Specifies a day of the week to which the rule is applied.

| |

Start

|

Specifies the monthly recurrence’s start date.

| |

End

|

Specifies the monthly recurrence’s end date.

| |

OccurrenceCount

|

Specifies how many times a monthly rule occurs.

| |

Interval

|

Specifies the monthly recurrence’s interval.

|

Work time patterns:

  • Every second Friday in a month has a different work time.

  • Every 10th of the month is a day off (for three months).

Yearly

The Yearly class contains settings for a yearly recurrence pattern.

|

Property

|

Description

| | --- | --- | |

CalculateByDayOfWeek

|

Specifies whether the Gantt control applies the rule according to the day of the week.

| |

Day

|

Specifies a day.

| |

Month

|

Specifies a month.

| |

DayOfWeekOccurrence

|

Specifies a day of the week’s occurrence.

| |

DayOfWeek

|

Specifies the day of the week to which the rule is applied.

| |

Start

|

Specifies the yearly recurrence’s start date.

| |

End

|

Specifies the yearly recurrence’s end date.

| |

OccurrenceCount

|

Specifies how many times a yearly rule occurs.

| |

Interval

|

Specifies the yearly recurrence’s interval.

|

Work time patterns:

  • Every year a day off is May 27.

  • The work day before a holiday is shortened by one hour.

See Also

ASPxGantt

ASPxClientGantt