Free Support Forum - aspose.com

Calendar Hours question - Urgent question

In Ms Project I'm able to define the number of working hours for a specific day (ie for day 16.01.2008 resource will work only 4 hours). I'm trying to do the same in Aspose.tasks but it only allow me to do this for all mondays, tuesdays, etc...

I've checked several posts where you define default hours per day (when you say day you mean Monday, Tuesday, etc...).

ch = cal.GetCalendarHours(Aspose.Tasks.DayOfWeek.Wednesday);
ch.FromTime1 = System.DateTime.Parse("08:00:00");
ch.ToTime1 = System.DateTime.Parse("12:00:00");
ch.FromTime2 = System.DateTime.Parse("13:00:00");
ch.ToTime2 = System.DateTime.Parse("17:00:00");

Can I do this for a specific day?

Dear rui.silva

Thanks for considering Aspose.Tasks.

Yes, you can add it for a specific day, but I need to check it how and will post a code snippet here as soon as possible.

Hello Shakeel,

Do you already now something about this subject?

Thanks,

Rui

Dear Rui,

Can you please attach some source project file where you had set working hours for specific date in MS-Project, so I could read and check it in Aspose.Task?

Dear Rui,

CalendarHours used to define standard calendar days.
If you need define special days you should use CalendarPeriods.
You will find example on this page. It shows how to define additional non-working day
but CalendarPeriod has also FromTime/ToTime properties.

Thanks for you feedback.

I'll try it with the Calendar Periods.

Rui Silva