ITsCalendarSettings.RestDays

Fore Syntax

RestDays: DayOfWeekSet;

Fore.NET Syntax

RestDays: Prognoz.Platform.Interop.Dimensions.DayOfWeekSet;

Description

The RestDays property determines days off in a week.

Comments

The property is relevant for series with daily calendar frequency.

Fore 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.

Fore.NET Example

The example displays a custom series calculation method.

Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Transform;

Function RestDays(Input: ITimeSeries): ITimeSeries;
Var
    TsCalc: TsCalculation;
    pContext: ITsCalculationContext;
    i: Integer;
    pSeries: ITimeSeries;
    CalendSett: ITsCalendarSettings;
Begin
    TsCalc := New TsCalculation.Create();
    pContext := TsCalc.Current[Null];
    pSeries := pContext.CreateTimeSeries(-1 As DimCalendarLevel, NullAs ITimeSeries;
    CalendSett := Input.CalendarSettings;
    If CalendSett.RestDays = DayOfWeekSet.dowsSaturdaySunday Then
        For i := Input.StartIndex To Input.EndIndex Do
            pSeries.Item[i] := 1 + (Input.Item[i] As double);
        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