Interface ICalendar
-
- All Known Implementing Classes:
Calendar
public interface ICalendarRepresents a calendar abstraction which can be used for various calculations of dates and durations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DategetFinishDateByStartAndWork(Date start, double work)Calculates the date when the specified amount of work time will pass according to the calendar.DategetFinishDateByStartAndWork(Date start, Duration work)Calculates the date when the specified amount of work time will pass according to the calendar.DategetNextWorkingDayStart(Date date)Calculates next working day start for the specified date.DategetPreviousWorkingDayEnd(Date date)Calculates the end of the previous working date from the specified date.DategetStartDateFromFinishAndDuration(Date finish, double duration)Returns start date based on specified finish date and duration.DategetStartDateFromFinishAndDuration(Date finish, Duration duration)Returns start date based on the specified finish date and duration.DategetTaskFinishDateFromDuration(Task task, double duration)Calculates the task finish date and time from its start date, split parts and the work duration.doublegetWorkingHours(Date dt)Returns the amount of working hours at the specified date.WorkUnitgetWorkingHours(Date start, Date finish)Return WorkUnit - Start, Finish and Duration of working hours for the specified date time interval.doublegetWorkingHoursTimeSpan(Date start, Date finish)Returns amount of working hours between the specified dates.WorkingTimeCollectiongetWorkingTimes(Date dt)ReturnsWorkingTimeCollectionof working times for the specified date.DategetWorkStart(Date date)Calculates next working time start beginning from the specified date and time.booleanisDayWorking(Date dt)Determines whether the specified day is a working day according to the calendar.booleanisEmpty()Returns whether the calendar doesn't have working hours defined.
-
-
-
Method Detail
-
getFinishDateByStartAndWork
Date getFinishDateByStartAndWork(Date start, Duration work)
Calculates the date when the specified amount of work time will pass according to the calendar.
- Parameters:
start- Start date.work- Work duration.- Returns:
- Finish date.
-
getFinishDateByStartAndWork
Date getFinishDateByStartAndWork(Date start, double work)
Calculates the date when the specified amount of work time will pass according to the calendar.
- Parameters:
start- Start date.work- Work duration.- Returns:
- Finish date.
-
getNextWorkingDayStart
Date getNextWorkingDayStart(Date date)
Calculates next working day start for the specified date.
- Parameters:
date- The date to get next working day start for.- Returns:
- Next working day start
System.DateTime.
-
getPreviousWorkingDayEnd
Date getPreviousWorkingDayEnd(Date date)
Calculates the end of the previous working date from the specified date.
- Parameters:
date- the date to calculate the previous working day end.- Returns:
- The end of the previous working day end
-
getStartDateFromFinishAndDuration
Date getStartDateFromFinishAndDuration(Date finish, Duration duration)
Returns start date based on the specified finish date and duration.
- Parameters:
finish- The specified finish date.duration- The specified duration.- Returns:
- Calculated start date.
-
getStartDateFromFinishAndDuration
Date getStartDateFromFinishAndDuration(Date finish, double duration)
Returns start date based on specified finish date and duration.
- Parameters:
finish- The specified finish date.duration- The specified duration.- Returns:
- Calculated start date.
-
getTaskFinishDateFromDuration
Date getTaskFinishDateFromDuration(Task task, double duration)
Calculates the task finish date and time from its start date, split parts and the work duration.
- Parameters:
task- The task to calculate finish date for.duration- The duration to calculate.Returns DateTime.MinValue if task is summary, null or its start date is not set.
- Returns:
- Task's finish date for the given start date and duration.
-
getWorkStart
Date getWorkStart(Date date)
Calculates next working time start beginning from the specified date and time.
- Parameters:
date- The date and time.- Returns:
- The nearest working time start.
-
getWorkingHours
WorkUnit getWorkingHours(Date start, Date finish)
Return WorkUnit - Start, Finish and Duration of working hours for the specified date time interval.
- Parameters:
start- Start date of the interval.finish- Finish date of the interval.- Returns:
- Instance of
WorkUnitclass containing Start, Finish and Duration of working hours.
-
getWorkingHours
double getWorkingHours(Date dt)
Returns the amount of working hours at the specified date.
- Parameters:
dt- The date to get working hours for.- Returns:
- Working hours at the specified date.
-
getWorkingHoursTimeSpan
double getWorkingHoursTimeSpan(Date start, Date finish)
Returns amount of working hours between the specified dates.
- Parameters:
start- Start date of the interval.finish- Finish date of the interval.- Returns:
- Amount of working hours according to the calendar instance.
-
getWorkingTimes
WorkingTimeCollection getWorkingTimes(Date dt)
Returns
WorkingTimeCollectionof working times for the specified date.- Parameters:
dt- The date to get working times for.- Returns:
- Collection of
WorkingTimeinstances.
-
isDayWorking
boolean isDayWorking(Date dt)
Determines whether the specified day is a working day according to the calendar.
- Parameters:
dt- The date to check whether the day is working.- Returns:
- True if the day is a working day.
-
isEmpty
boolean isEmpty()
Returns whether the calendar doesn't have working hours defined.
- Returns:
- True if the calendar doesn't have working hours defined.
-
-