Reference > TDBCalendar Control > TDBCalendar Control Properties > WeekRests Property (TDBCalendar) |
The WeekRests() array property is used to define which week of the weekdays will become a weekend. By default, all every week for Sunday and Saturday will become a weekend.
object.WeekRests(Index)= value’
Read/Write at run time and design time.
Design Time |
Run Time |
-1 - All |
dbiAllWeeks |
0 - None (Default) |
dbiNoWeeks |
1 - First Week |
dbi1stWeek |
2 - Second Week |
dbi2ndWeek |
4 - Third Week |
dbi3rdWeek |
8 - Fourth Week |
dbi4thWeek |
1 - Fifth Week |
dbi1stWeek |
32 - Last Week |
dbiLastWeek |
64 - Override Weekday |
dbiOverrideWeekday |
The WeekRests() is a property array, starting from Sunday, elements 1 through 7 holds each weekday's information:
1 |
Sunday |
2 |
Monday |
3 |
Tuesday |
4 |
Wednesday |
5 |
Thursday |
6 |
Friday |
7 |
Saturday |
Since a weekday can have more than one week as a weekend, use the appropriate numbers in combination. For example, to set the first and third week for Saturday to be a weekend, it will be as follows.
Calendar.WeekRests(7) = 1 Or 4
' First and third week
When a weekday sets the "Override" flag, it means that when a holiday specified in the HolidayStyles collection object lands on any week of this weekday, the holiday will be overridden, and the next day will automatically become a holiday.
Calendar.WeekRests(7) = 1 Or 4 Or 64
' First and third week and override
Any holiday that lands on Sunday will automatically be overridden.
Use the WeekDays() property to determine the attribute styles to use for the weekdays.
When all the elements of the WeekRests() array property is set to 0-None, the attribute settings specified in the WeekDays objects will be ignored.