Skip to main content

Introducing Formengine - The New Formbuilder, try for FREE formengine.io.

Interface ICalendar

Work calendar

Namespace: OptimaJet.Workflow.Core.Runtime.Calendars

Assembly: OptimaJet.Workflow.Core.dll

Syntax
public interface ICalendar

Methods

IsWorkday(DateTime)

Checking whether the day is a working day

Declaration
bool IsWorkday(DateTime day)
Parameters
TypeNameDescription
DateTimedayDateTime instance
Returns
TypeDescription
booltrue if day is workday, false otherwise

IsWorkTime(DateTime)

Checking whether the specified date and time fall within working hours

Declaration
bool IsWorkTime(DateTime datetime)
Parameters
TypeNameDescription
DateTimedatetimeThe date and time to check
Returns
TypeDescription
bool<code>true</code> if the time is withing working hours on a workday; otherwise <code>false</code>

GetRestOfWorkday(DateTime)

Get the rest of the workday

Declaration
TimeSpan GetRestOfWorkday(DateTime day)
Parameters
TypeNameDescription
DateTimedayDateTime instance
Returns
TypeDescription
TimeSpanTimeSpan with the rest of the working day

GetStartOfWorkday(DateTime)

Get the start of the workday

Declaration
TimeSpan GetStartOfWorkday(DateTime day)
Parameters
TypeNameDescription
DateTimedayDateTime instance
Returns
TypeDescription
TimeSpanStart of the workday

FindWorkDayStart(DateTime)

Finds the next start of a workday beginning from the specified date and time

Declaration
DateTime FindWorkDayStart(DateTime searchFrom)
Parameters
TypeNameDescription
DateTimesearchFromThe date and time to start searching from
Returns
TypeDescription
DateTimeThe date and time representing the start of the next workday

FindWorkDayEnd(DateTime)

Finds the next end of a workday beginning from the specified date and time

Declaration
DateTime FindWorkDayEnd(DateTime searchFrom)
Parameters
TypeNameDescription
DateTimesearchFromThe date and time to start searching from
Returns
TypeDescription
DateTimeThe date and time representing the end of the next workday

FindWorkDayTime(DateTime)

Returns the given time if it falls within working hours, or the start of the next workday otherwise

Declaration
DateTime FindWorkDayTime(DateTime searchFrom)
Parameters
TypeNameDescription
DateTimesearchFromThe date and time to start searching from
Returns
TypeDescription
DateTimeA date and time that falls withing working hours

GetWorkDaysInRange(DateTime, DateTime)

Returns a list of workdays between two dates, using the start time of each workday

Declaration
List<DateTime> GetWorkDaysInRange(DateTime from, DateTime to)
Parameters
TypeNameDescription
DateTimefromThe start date of the range
DateTimetoThe end date of the range
Returns
TypeDescription
List<DateTime>A list of dates representing the start of each workday in the specified range

Extension Methods