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
-
ObjectTimeEnumerable
- 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
startDateDateTimeStart of period.
endDateDateTimeEnd of period.
timeIntervalTypeTimeIntervalTypeInterval granularity.
intervalHandlingIntervalHandlingInterval handling type.
firstDayOfWeekDayOfWeekAn 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
startDateDateTimeStart of period.
endDateDateTimeEnd of period.
timeIntervalTypeTimeIntervalTypeInterval granularity.
firstDayOfWeekDayOfWeekAn 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.