ITimeSeries.CalendarSettings

Fore Syntax

CalendarSettings: IMsCalendarSettings;

Fore.NET Syntax

CalendarSettings: Prognoz.Platform.Interop.Ms.IMsCalendarSettings;

Description

The property is read-only.

The CalendarSettings property returns the calendar level parameters for custom calculation method.

Comments

By using this property the first day of the week, the number of days off and other parameters can be modified.

Fore Example

This example displays 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 input series values if the series days off are Saturday and Sunday.

Fore.NET Example

This example displays 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 input series values if the series days off are Saturday and Sunday.

See also:

ITimeSeries