Workflow Engine .NET

Assembly: OptimaJet.Workflow.Core

Class Calendar

OptimaJet.Workflow.Core.Runtime.Calendars.Calendar

Work calendar

public class Calendar : ICalendar

Inheritance

  • System.Object

Implemented Interfaces

Properties

Name
Type
Name #
String
Name of the calendar
WorkingHours #
TimeSpan
Working hours. Default 8 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

public 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
public 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
public 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 work day
public 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
public 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
public 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
public 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
public 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
public static Calendar Create(string name) #
Create instance of the calendar

Parameters

Name
Type
Description
name
String
Name of the calendar

Returns

Type
Description
Calendar
public override bool Equals(object obj) #

Parameters

Name
Type
Description
obj
Object

Returns

Type
Description
Boolean
public override int GetHashCode() #

Returns

Type
Description
Int32