Extensive time period calculations and individual calendar periods.
A while ago we had to write an EPG for a WP8 TV app that we’re building for a client. As part of this we had the need to do some pretty difficult DateTime calculations.
Finding out if a C# DateTime is within a time range is hard. Finding out if two time ranges intersect is even harder!
Install this little Nuget package and you can do stuff like:
var cellTimeRange = new TimeRange(nowTime.AddHours(-2), nowTime.AddHours(3)); var timeCellsInRange = cell.TimeCells.Where(_ =&gt; new TimeRange(_.StartTime, _.EndTime).IntersectsWith(cellTimeRange)).ToList();
How cool is that!