ITsCalendarSettings.RestDays

Syntax

RestDays: DayOfWeekSet;

Description

The RestDays property determines days off in a week.

Comments

The property is relevant for series with daily calendar frequency.

Example

This example displays a custom series calculation method. To execute the example, add links to the Dimensions, Ms, Transform system assemblies.

Function RestDays(Input: ITimeSeries): ITimeSeries;
Var
    TsCalc: TsCalculation;
    pContext: ITsCalculationContext;
    i: Integer;
    pSeries: ITimeSeries;
    CalendSett: ITsCalendarSettings;
Begin
    TsCalc := New TsCalculation.Create;
    pContext := TsCalc.Current;;
    pSeries := pContext.CreateTimeSeries;
    CalendSett := Input.CalendarSettings;
    If CalendSett.RestDays = DayOfWeekSet.SaturdaySunday Then
        For i := Input.StartIndex To Input.EndIndex Do
            pSeries.Item(i) := 1 + Input.Item(i);
        End For;
    End If;
    Return pSeries;
End Function RestDays;

The method increases value of the input series if Saturday and Sunday are the days off.

See also:

ITsCalendarSettings