private Func <LogGrouping, MainLogSection> flatten(GroupingStrategy groupingStrategy, int dayInLog, int daysInThePast) { return(day => { var items = groupingStrategy(day); var title = DateToTitleString.Convert(day.Key, timeService.CurrentDateTime); var duration = totalTrackedTime(items).ToFormattedString(durationFormat); return new MainLogSection( new DaySummaryViewModel(day.Key, title, duration), flattenGroups(items, dayInLog, daysInThePast) ); }); }
private Func <LogGrouping, MainLogSection> flatten( Func <IEnumerable <IThreadSafeTimeEntry>, IEnumerable <IThreadSafeTimeEntry[]> > groupingStrategy) { return(day => { var items = groupingStrategy(day); var title = DateToTitleString.Convert(day.Key, timeService.CurrentDateTime); var duration = totalTrackedTime(items).ToFormattedString(durationFormat); return new MainLogSection( new DaySummaryViewModel(day.Key, title, duration), flattenGroups(items) ); }); }