Interface ICalendar
OptimaJet.Workflow.Core.Runtime.Calendars.ICalendar
Work calendar
Namespace: OptimaJet.Workflow.Core.Runtime.Calendars
public interface ICalendarProperties
Name
Type
Name #StringName of the calendar
WorkingHours #TimeSpanWorking hours
StartOfWork #TimeSpanThe 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
dayDateTimeDateTime instance
Returns
Type
Description
Booleantrue 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
datetimeDateTimeThe date and time to check
Returns
Type
Description
Booleantrue if the time is withing working hours on a workday; otherwise falseTimeSpan GetRestOfWorkday(DateTime day) #Get the rest of the workday
Parameters
Name
Type
Description
dayDateTimeDateTime instance
Returns
Type
Description
TimeSpanTimeSpan with the rest of the working day
TimeSpan GetStartOfWorkday(DateTime day) #Get the start of the workday
Parameters
Name
Type
Description
dayDateTimeDateTime instance
Returns
Type
Description
TimeSpanStart 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
searchFromDateTimeThe date and time to start searching from
Returns
Type
Description
DateTimeThe 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
searchFromDateTimeThe date and time to start searching from
Returns
Type
Description
DateTimeThe 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
searchFromDateTimeThe date and time to start searching from
Returns
Type
Description
DateTimeA 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
fromDateTimeThe start date of the range
toDateTimeThe end date of the range
Returns
Type
Description
List<DateTime>A list of dates representing the start of each workday in the specified range