Workflow Engine .NET

Assembly: OptimaJet.Workflow.Core

Interface ICalendar

OptimaJet.Workflow.Core.Runtime.Calendars.ICalendar

Work calendar

public interface ICalendar

Properties

Name
Type
Name #
String
Name of the calendar
WorkingHours #
TimeSpan
Working hours
StartOfWork #
TimeSpan
The beginning of the work day
Weekends #
List<DayOfWeek>
Days of the week for weekends
Years #
Dictionary<Year>
Settings for years Year

Methods

bool IsWorkday(DateTime day) #
Checking whether the day is a working day

Parameters

Name
Type
Description
day
DateTime
DateTime instance

Returns

Type
Description
Boolean
true if day is workday, false otherwise
bool IsWorkTime(DateTime datetime) #
Checking whether the specified date and time fall within working hours

Parameters

Name
Type
Description
datetime
DateTime
The date and time to check

Returns

Type
Description
Boolean
true if the time is withing working hours on a workday; otherwise false
TimeSpan GetRestOfWorkday(DateTime day) #
Get the rest of the workday

Parameters

Name
Type
Description
day
DateTime
DateTime instance

Returns

Type
Description
TimeSpan
TimeSpan with the rest of the working day
TimeSpan GetStartOfWorkday(DateTime day) #
Get the start of the workday

Parameters

Name
Type
Description
day
DateTime
DateTime instance

Returns

Type
Description
TimeSpan
Start of the workday
DateTime FindWorkDayStart(DateTime searchFrom) #
Finds the next start of a workday beginning from the specified date and time

Parameters

Name
Type
Description
searchFrom
DateTime
The date and time to start searching from

Returns

Type
Description
DateTime
The date and time representing the start of the next workday
DateTime FindWorkDayEnd(DateTime searchFrom) #
Finds the next end of a workday beginning from the specified date and time

Parameters

Name
Type
Description
searchFrom
DateTime
The date and time to start searching from

Returns

Type
Description
DateTime
The date and time representing the end of the next workday
DateTime FindWorkDayTime(DateTime searchFrom) #
Returns the given time if it falls within working hours, or the start of the next workday otherwise

Parameters

Name
Type
Description
searchFrom
DateTime
The date and time to start searching from

Returns

Type
Description
DateTime
A date and time that falls withing working hours
List<DateTime> GetWorkDaysInRange(DateTime from, DateTime to) #
Returns a list of workdays between two dates, using the start time of each workday

Parameters

Name
Type
Description
from
DateTime
The start date of the range
to
DateTime
The end date of the range

Returns

Type
Description
List<DateTime>
A list of dates representing the start of each workday in the specified range

Derived Types