Interface ICalendar

Interface ICalendar

Namespace: Aspose.Tasks
Assembly: Aspose.Tasks.dll (25.4.0)

Represents a calendar abstraction which can be used for various calculations of dates and durations.

public interface ICalendar

Methods

GetFinishDateByStartAndWork(DateTime, Duration)

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

DateTime GetFinishDateByStartAndWork(DateTime start, Duration work)

Parameters

start DateTime

Start date.

work Duration

Work duration.

Returns

DateTime

Finish date.

GetFinishDateByStartAndWork(DateTime, TimeSpan)

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

DateTime GetFinishDateByStartAndWork(DateTime start, TimeSpan work)

Parameters

start DateTime

Start date.

work TimeSpan

Work duration.

Returns

DateTime

Finish date.

GetNextWorkingDayStart(DateTime)

Calculates next working day start for the specified date.

DateTime GetNextWorkingDayStart(DateTime date)

Parameters

date DateTime

The date to get next working day start for.

Returns

DateTime

Next working day start System.DateTime.

GetPreviousWorkingDayEnd(DateTime)

Calculates the end of the previous working date from the specified date.

DateTime GetPreviousWorkingDayEnd(DateTime date)

Parameters

date DateTime

the date to calculate the previous working day end.

Returns

DateTime

The end of the previous working day end

GetStartDateFromFinishAndDuration(DateTime, Duration)

Returns start date based on the specified finish date and duration.

DateTime GetStartDateFromFinishAndDuration(DateTime finish, Duration duration)

Parameters

finish DateTime

The specified finish date.

duration Duration

The specified duration.

Returns

DateTime

Calculated start date.

GetStartDateFromFinishAndDuration(DateTime, TimeSpan)

Returns start date based on specified finish date and duration.

DateTime GetStartDateFromFinishAndDuration(DateTime finish, TimeSpan duration)

Parameters

finish DateTime

The specified finish date.

duration TimeSpan

The specified duration.

Returns

DateTime

Calculated start date.

GetTaskFinishDateFromDuration(Task, TimeSpan)

Calculates the task finish date and time from its start date, split parts and the work duration.

DateTime GetTaskFinishDateFromDuration(Task task, TimeSpan duration)

Parameters

task Task

The task to calculate finish date for.

duration TimeSpan

The duration to calculate.

Returns

DateTime

Task’s finish date for the given start date and duration.

Remarks

Returns DateTime.MinValue if task is summary, null or its start date is not set.

GetWorkingHours(DateTime, DateTime)

Return WorkUnit - Start, Finish and Duration of working hours for the specified date time interval.

WorkUnit GetWorkingHours(DateTime start, DateTime finish)

Parameters

start DateTime

Start date of the interval.

finish DateTime

Finish date of the interval.

Returns

WorkUnit

Instance of Aspose.Tasks.WorkUnit class containing Start, Finish and Duration of working hours.

GetWorkingHours(DateTime)

Returns the amount of working hours at the specified date.

TimeSpan GetWorkingHours(DateTime dt)

Parameters

dt DateTime

The date to get working hours for.

Returns

TimeSpan

Working hours at the specified date.

GetWorkingTimes(DateTime)

Returns Aspose.Tasks.WorkingTimeCollection of working times for the specified date.

WorkingTimeCollection GetWorkingTimes(DateTime dt)

Parameters

dt DateTime

The date to get working times for.

Returns

WorkingTimeCollection

Collection of Aspose.Tasks.WorkingTime instances.

IsDayWorking(DateTime)

Determines whether the specified day is a working day according to the calendar.

bool IsDayWorking(DateTime dt)

Parameters

dt DateTime

The date to check whether the day is working.

Returns

bool

True if the day is a working day.

 English