Workflow Engine .NET

Assembly: OptimaJet.Workflow.Core

Interface ICalendar

OptimaJet.Workflow.Core.Runtime.Calendars.ICalendar

Represents a calendar that defines workdays and working-time boundaries.

public interface ICalendar

Properties

Name
Type
Name #
String
Gets or sets the calendar name.
WorkingHours #
TimeSpan
Gets or sets the default working duration for a workday.
StartOfWork #
TimeSpan
Gets or sets the default start time of the workday.
Weekends #
List<DayOfWeek>
Gets or sets the days of week that are weekends.
Years #
Dictionary<Int32, Year>
Gets or sets year-specific calendar settings.

Methods

bool IsWorkday(DateTime day) #
Determines whether the specified date is a workday.

Parameters

Name
Type
Description
day
DateTime
The date to evaluate.

Returns

Type
Description
Boolean
true if the date is a workday; otherwise, false.
bool IsWorkTime(DateTime datetime) #
Determines whether the specified date is a workday and its time has not passed the end of that workday.

Parameters

Name
Type
Description
datetime
DateTime
The date and time to evaluate.

Returns

Type
Description
Boolean
true if datetime is on a workday and is no later than the end of that workday; otherwise, false.
TimeSpan GetRestOfWorkday(DateTime day) #
Gets the duration from the specified date and time to the configured end of its workday.

Parameters

Name
Type
Description
day
DateTime
The date and time to evaluate.

Returns

Type
Description
TimeSpan
The duration until the configured workday end. The value is negative when day is later than that time.
TimeSpan GetStartOfWorkday(DateTime day) #
Gets the configured start time of the workday for the specified date.

Parameters

Name
Type
Description
day
DateTime
The date used to resolve individual workday settings.

Returns

Type
Description
TimeSpan
The individual start time configured for the date, or the default start time.
DateTime FindWorkDayStart(DateTime searchFrom) #
Finds the first workday start strictly later than the specified date and time.

Parameters

Name
Type
Description
searchFrom
DateTime
The exclusive lower bound for the search.

Returns

Type
Description
DateTime
The date and time when the matching workday starts.
DateTime FindWorkDayEnd(DateTime searchFrom) #
Finds the first workday end strictly later than the specified date and time.

Parameters

Name
Type
Description
searchFrom
DateTime
The exclusive lower bound for the search.

Returns

Type
Description
DateTime
The date and time when the matching workday ends.
DateTime FindWorkDayTime(DateTime searchFrom) #
Returns the specified date and time when it is accepted by ICalendar.IsWorkTime(DateTime); otherwise, finds the first subsequent workday start.

Parameters

Name
Type
Description
searchFrom
DateTime
The date and time to evaluate.

Returns

Type
Description
DateTime
searchFrom if it is accepted by ICalendar.IsWorkTime(DateTime); otherwise, the next workday start time.
List<DateTime> GetWorkDaysInRange(DateTime from, DateTime to) #
Gets the workday start times strictly between the specified bounds.

Parameters

Name
Type
Description
from
DateTime
The exclusive lower bound of the range.
to
DateTime
The exclusive upper bound of the range.

Returns

Type
Description
List<DateTime>
The workday start times that are later than from and earlier than to, ordered chronologically.

Derived Types