Skip to main content

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

Class Year

Work year settings

Inheritance

↳ object

    ↳ Year

Inherited Members

Equals(object, object)

GetType()

MemberwiseClone()

ReferenceEquals(object, object)

ToString()

Namespace: OptimaJet.Workflow.Core.Runtime.Calendars

Assembly: OptimaJet.Workflow.Core.dll

Syntax
public class Year

Properties

YearNumber

Year number, for example 2023

Declaration
public int YearNumber { get; }
Property value
TypeDescription
int

Holidays

Holidays

Declaration
public List<MonthDay> Holidays { get; }
Property value
TypeDescription
List<MonthDay>

Workdays

Setting up individual days

Declaration
public List<Workday> Workdays { get; }
Property value
TypeDescription
List<Workday>

Methods

IsWorkday(DateTime, bool)

Checking whether the day is a workday

Declaration
public bool IsWorkday(DateTime day, bool weekend)
Parameters
TypeNameDescription
DateTimedayDay instance
boolweekendFlag whether the day is a weekend according to the calendar
Returns
TypeDescription
booltrue if day is workday, false otherwise

GetDayTime(DateTime)

Get all working hours on the day

Declaration
public TimeSpan? GetDayTime(DateTime day)
Parameters
TypeNameDescription
DateTimedayDay instance
Returns
TypeDescription
TimeSpan?working hours or null if the year has no data

Create(int)

Create instance of the year

Declaration
public static Year Create(int year)
Parameters
TypeNameDescription
intyearNumber of the year
Returns
TypeDescription
YearYear instance

SetHolidays(params MonthDay[])

Set holidays in this year

Declaration
public Year SetHolidays(params MonthDay[] holidays)
Parameters
TypeNameDescription
OptimaJet.Workflow.Core.Runtime.Calendars.MonthDay[]holidaysArray of the holidays
Returns
TypeDescription
YearYear instance

SetHoliday(Months, int)

Set holiday in this year

Declaration
public Year SetHoliday(Months month, int day)
Parameters
TypeNameDescription
MonthsmonthMonth
intdayDay number
Returns
TypeDescription
YearYear instance

SetWorkdays(params Workday[])

Set workdays

Declaration
public Year SetWorkdays(params Workday[] workdays)
Parameters
TypeNameDescription
OptimaJet.Workflow.Core.Runtime.Calendars.Workday[]workdaysArray of the Workday
Returns
TypeDescription
YearYear instance

SetWorkday(Months, int, TimeSpan, TimeSpan)

Set workday

Declaration
public Year SetWorkday(Months month, int day, TimeSpan startTimeOfDay, TimeSpan workingHours)
Parameters
TypeNameDescription
MonthsmonthMonth
intdayDay number
TimeSpanstartTimeOfDayThe beginning of the working day
TimeSpanworkingHoursWorking hours
Returns
TypeDescription
YearYear instance

Equals(object)

Declaration
public override bool Equals(object obj)
Parameters
TypeNameDescription
objectobj
Returns
TypeDescription
bool

GetHashCode()

Declaration
public override int GetHashCode()
Returns
TypeDescription
int

Extension Methods