Hi everyone,
I am trying to create a custom calendar that has working hours of 08:00 to 17:00 without the usual 1 hour break. The code is pretty vanilla -
Project project = new Project();
Calendar cal = project.Calendars.Add("MyTest");
WorkingTime wt1 = new WorkingTime(new DateTime(10, 1, 1, 8, 0, 0,0), new DateTime(10, 1, 1, 17, 0, 0));
cal.WeekDays[0].FromDate = new DateTime(1, 1, 1, 0, 0, 0);
cal.WeekDays[0].ToDate = new DateTime(1, 1, 1, 0, 0,0);
var workingtimes = cal.WeekDays[0].WorkingTimes[1];
cal.WeekDays[0].WorkingTimes.Remove(workingtimes);
cal.WeekDays[0].WorkingTimes[0] = wt1 ;
cal.WeekDays[0].DayWorking = true;
And I can see that the object is created correctly (only working on Monday and it shows 08:00 to 17:00)
image.png (22.8 KB)
but in MS Project it shows the usual work hours-
image.png (33.5 KB)
Any ideas?