Class TimeEnumerable
Helper for time interval generation. TODO: add handling for date vs datetime
Inheritance
System.Object
TimeEnumerable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: TimeCockpit.Data.DataModel
Assembly: TimeCockpit.Data.dll
Syntax
public static class TimeEnumerable
Methods
IntervalDurationRange(DateTime, DateTime, TimeIntervalType, IntervalHandling, DayOfWeek)
Get idurations for a range in discrete intervals (in date granularity).
Declaration
public static List<Duration> IntervalDurationRange(DateTime startDate, DateTime endDate, TimeIntervalType timeIntervalType, IntervalHandling intervalHandling, DayOfWeek firstDayOfWeek = DayOfWeek.Sunday)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | startDate | Start of period. |
System.DateTime | endDate | End of period. |
TimeIntervalType | timeIntervalType | Interval granularity. |
IntervalHandling | intervalHandling | Interval handling type. |
System.DayOfWeek | firstDayOfWeek | An enumeration value that represents the first day of the week. The default is DayOfWeek.Sunday. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Duration> | All intervals in the given period. |
IntervalEndRange(DateTime, DateTime, TimeIntervalType, DayOfWeek)
Generates all interval end dates in the given period.
Declaration
public static List<DateTime> IntervalEndRange(DateTime startDate, DateTime endDate, TimeIntervalType timeIntervalType, DayOfWeek firstDayOfWeek = DayOfWeek.Sunday)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | startDate | Start of period. |
System.DateTime | endDate | End of period. |
TimeIntervalType | timeIntervalType | Interval granularity. |
System.DayOfWeek | firstDayOfWeek | An enumeration value that represents the first day of the week. The default is DayOfWeek.Sunday. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.DateTime> | All interval end dates in the given period. |