ICalendarWeekLevel.RestDays

Syntax

RestDays: DayOfWeekSet;

Description

The RestDays property determines weekends. Weekends are excluded on building a level.

NOTE. This property returns 0 if seven-day week is set for the Weeks level, or 96 if a five-day week is set. See Calendar Dictionary Creation Wizard

Example

Sub UserProc;
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    ClnDim: ICalendarDimension;
    WeekLvl: ICalendarWeekLevel;
Begin
    MB := MetabaseClass.Active;
    // Create calendar dictionary
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_CLNDIM;
    CrInfo.Id := "CALENDAR_DIM";
    CrInfo.Name := "Calendar dictionary";
    CrInfo.Parent := MB.Root;
    ClnDim := MB.CreateObject(CrInfo).Edit As ICalendarDimension;
    // Set up calendar dictionary parameters
    ClnDim.Hierarchy := 3;
    ClnDim.StartYear := 2015;
    ClnDim.EndYear := 2016;
    ClnDim.IncludeYears := True;
    ClnDim.IncludeWeek := True;
    ClnDim.IncludeDays := True;
    WeekLvl := ClnDim.WeekLevel;
    WeekLvl.RestDays := DayOfWeekSet.Friday;
    (ClnDim As IMetabaseObject).Save;
End Sub UserProc;

After executing the example a calendar dictionary with the CALENDAR_DIM identifier is created in repository root. Dictionary hierarchy includes Years, Weeks, and Days levels. All days except Friday are included into the Weeks level on its creation:

See also:

ICalendarWeekLevel