Table of Contents

Class TimeEnumerable

Namespace
TimeCockpit.Data.DataModel
Assembly
TimeCockpit.Data.dll

Helper for time interval generation. TODO: add handling for date vs datetime

public static class TimeEnumerable
Inheritance
Object
TimeEnumerable
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()

Methods

IntervalDurationRange(DateTime, DateTime, TimeIntervalType, IntervalHandling, DayOfWeek)

Get idurations for a range in discrete intervals (in date granularity).

public static List<Duration> IntervalDurationRange(DateTime startDate, DateTime endDate, TimeIntervalType timeIntervalType, IntervalHandling intervalHandling, DayOfWeek firstDayOfWeek = DayOfWeek.Sunday)

Parameters

startDate DateTime

Start of period.

endDate DateTime

End of period.

timeIntervalType TimeIntervalType

Interval granularity.

intervalHandling IntervalHandling

Interval handling type.

firstDayOfWeek DayOfWeek

An enumeration value that represents the first day of the week. The default is DayOfWeek.Sunday.

Returns

List<Duration>

All intervals in the given period.

IntervalEndRange(DateTime, DateTime, TimeIntervalType, DayOfWeek)

Generates all interval end dates in the given period.

public static List<DateTime> IntervalEndRange(DateTime startDate, DateTime endDate, TimeIntervalType timeIntervalType, DayOfWeek firstDayOfWeek = DayOfWeek.Sunday)

Parameters

startDate DateTime

Start of period.

endDate DateTime

End of period.

timeIntervalType TimeIntervalType

Interval granularity.

firstDayOfWeek DayOfWeek

An enumeration value that represents the first day of the week. The default is DayOfWeek.Sunday.

Returns

List<DateTime>

All interval end dates in the given period.