Interface ICalendar
Work calendar
Namespace: OptimaJet.Workflow.Core.Runtime.Calendars
Assembly: OptimaJet.Workflow.Core.dll
Syntaxpublic interface ICalendar
Methods
IsWorkday(DateTime)
Checking whether the day is a working day
Declarationbool IsWorkday(DateTime day)
| Type | Name | Description | 
|---|---|---|
| DateTime | day | DateTime instance | 
| Type | Description | 
|---|---|
| bool | true if day is workday, false otherwise | 
IsWorkTime(DateTime)
Checking whether the specified date and time fall within working hours
Declarationbool IsWorkTime(DateTime datetime)
| Type | Name | Description | 
|---|---|---|
| DateTime | datetime | The date and time to check | 
| Type | Description | 
|---|---|
| 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
DeclarationTimeSpan GetRestOfWorkday(DateTime day)
| Type | Name | Description | 
|---|---|---|
| DateTime | day | DateTime instance | 
| Type | Description | 
|---|---|
| TimeSpan | TimeSpan with the rest of the working day | 
GetStartOfWorkday(DateTime)
Get the start of the workday
DeclarationTimeSpan GetStartOfWorkday(DateTime day)
| Type | Name | Description | 
|---|---|---|
| DateTime | day | DateTime instance | 
| Type | Description | 
|---|---|
| TimeSpan | Start of the workday | 
FindWorkDayStart(DateTime)
Finds the next start of a workday beginning from the specified date and time
DeclarationDateTime FindWorkDayStart(DateTime searchFrom)
| Type | Name | Description | 
|---|---|---|
| DateTime | searchFrom | The date and time to start searching from | 
| Type | Description | 
|---|---|
| DateTime | The 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
DeclarationDateTime FindWorkDayEnd(DateTime searchFrom)
| Type | Name | Description | 
|---|---|---|
| DateTime | searchFrom | The date and time to start searching from | 
| Type | Description | 
|---|---|
| DateTime | The 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
DeclarationDateTime FindWorkDayTime(DateTime searchFrom)
| Type | Name | Description | 
|---|---|---|
| DateTime | searchFrom | The date and time to start searching from | 
| Type | Description | 
|---|---|
| DateTime | A 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
DeclarationList<DateTime> GetWorkDaysInRange(DateTime from, DateTime to)
| Type | Name | Description | 
|---|---|---|
| DateTime | from | The start date of the range | 
| DateTime | to | The end date of the range | 
| Type | Description | 
|---|---|
| List<DateTime> | A list of dates representing the start of each workday in the specified range |