FirstDayOfWeek: DayOfWeekSet;
The FirstDayOfWeek property determines the first day of the week.
Sub UserProc;
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
ClnDim: ICalendarDimension;
WeekLvl: ICalendarWeekLevel;
Begin
MB := MetabaseClass.Active;
// Create calendar dictionary
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_CLNDIM;
CrInfo.Id := "CALENDAR_DIM";
CrInfo.Name := "Calendar dictionary";
CrInfo.Parent := MB.Root;
ClnDim := MB.CreateObject(CrInfo).Edit As ICalendarDimension;
// Set up calendar dictionary parameters
ClnDim.Hierarchy := 3;
ClnDim.StartYear := 2015;
ClnDim.EndYear := 2016;
ClnDim.IncludeYears := True;
ClnDim.IncludeWeek := True;
ClnDim.IncludeDays := True;
WeekLvl := ClnDim.WeekLevel;
WeekLvl.FirstDayOfWeek := DayOfWeekSet.Sunday;
(ClnDim As IMetabaseObject).Save;
End Sub UserProc;
After executing the example a calendar dictionary with the CALENDAR_DIM identifier is created in repository root. Dictionary hierarchy includes Years, Weeks, and Days levels. The first day of the Weeks level is Sunday:
See also: