Class YearSchedule

This class is used to represent a year schedule. A year can be composed of several WeekSchedules.

Constructors

YearSchedule()

This class is used to represent a year schedule. A year can be composed of several WeekSchedules.

Declaration

YearSchedule

Methods

addTimeSpan(DateTime,TimeSpan)

This function adds a time span to the current year schedule.

Declaration

DateTime addTimeSpan(DateTime dt, TimeSpan sp)

Parameters

Type Name Description
DateTime dt Start time for calculation
TimeSpan sp The timespan to add (2 days, 1 hours, 5 minutes, 30 seconds...).

Returns

Type Description
DateTime

addWS(WeekSchedule,Integer,Integer)

This function adds a week schedule to the year schedule.

Declaration

Void addWS(WeekSchedule ws, Integer mStop, Integer dStop)

Parameters

Type Name Description
WeekSchedule ws Add this weekschedule to the yearschedule.
Integer mStop The given weekschedule is active to this month
Integer dStop The given weekschedule is active to this day.

Returns

Type Description
Void

getDifference(DateTime,DateTime)

Gets difference between two given times. The function returns a timespan.

Counting will skip inactive periodes, defined by the different weekschedules that may be crossed.

Declaration

TimeSpan getDifference(DateTime from, DateTime to)

Parameters

Type Name Description
DateTime from Count from this date.
DateTime to Count to this date.

Returns

Type Description
TimeSpan