Calendar.GetFinishDateByStartAndWork

GetFinishDateByStartAndWork(DateTime, Duration)

Calculates the date when the specified amount of work time will pass according to the calendar.

public DateTime GetFinishDateByStartAndWork(DateTime start, Duration work)
ParameterTypeDescription
startDateTimeStart date.
workDurationWork duration.

Return Value

Finish date.

Examples

Shows how to calculate a finish date by start date and work using a calendar instance.

var project = new Project(DataDir + "Blank2010.mpp");

var calendar = project.Calendars.GetByName("Standard");

var start = new DateTime(2017, 10, 26, 8, 0, 0);
var work = project.GetWork(7);

// calculate finish date by using a standard calendar
var finish = calendar.GetFinishDateByStartAndWork(start, work);

Console.WriteLine("Task start date: " + start);
Console.WriteLine("Task work: " + work);
Console.WriteLine("Task finish date: " + finish);

See Also


GetFinishDateByStartAndWork(DateTime, TimeSpan)

Calculates the date when the specified amount of work time will pass according to the calendar.

public DateTime GetFinishDateByStartAndWork(DateTime start, TimeSpan work)
ParameterTypeDescription
startDateTimeStart date.
workTimeSpanWork duration.

Return Value

Finish date.

Examples

Shows how to calculate a finish date by start date and work (as a time span) using a calendar instance.

var project = new Project(DataDir + "Blank2010.mpp");

var calendar = project.Calendars.GetByName("Standard");

var start = new DateTime(2017, 10, 26, 8, 0, 0);
var work = project.GetWork(7);

// calculate finish date by using a standard calendar
var finish = calendar.GetFinishDateByStartAndWork(start, work.TimeSpan);

Console.WriteLine("Task start date: " + start);
Console.WriteLine("Task work: " + work);
Console.WriteLine("Task finish date: " + finish);

See Also