WeekFromDate(Date: DateTime): Variant;
Date - the date for which it is necessary to calculate day parameters.
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:
The first element: year.
The second element: number of week.
The third element: number of day in the week.
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: