ICalendarDimension.WeekFromDate

Syntax

WeekFromDate(Date: DateTime): Variant;

Parameters

Date - the date for which it is necessary to calculate day parameters.

Description

The WeekFromDate method calculates parameters of the day corresponding to a specified date. Calculation takes into account week starting day and number of days in a week specified for this dictionary.

Executing this method results in an integer array containing the following values:

Example

Executing the example assumes that the repository contains a calendar dictionary with the CALENDAR_DIM identifier.

Sub Main;

Var

MB: IMetabase;

Dim: ICalendarDimension;

v: Array Of Integer;

Begin

MB := MetabaseClass.Active;

Dim := MB.ItemById("CALENDAR_DIM").Bind As ICalendarDimension;

v := Dim.WeekFromDate(DateTime.Now) As Array Of Integer;

Debug.WriteLine("Year - " + v[0].ToString);

Debug.WriteLine("Week - " + v[1].ToString);

Debug.WriteLine("Day - " + v[2].ToString);

End Sub Main;

Parameters of the current day are computed After executing the example. Calculation takes into account parameters of the CALENDAR_DIM dictionary. The results are displayed in development environment console.

See also:

ICalendarDimension | ICalendarDimension.DateFromWeek