I am trying to show the working hours / days intervals, it should look like this:

(source: clip2net.com )
I have a table where I store the day number, opening time and closing time for each day

(source: clip2net.com )
Then I created a request =>
var groups = from s in this.OpenTimes
orderby s.Day
group s by new { s.Till, s.Start } into gr
select new
{
Time = gr.Key.Start + "-" + gr.Key.Till,
Days = this.OpenTimes
.Where(o => o.Start == gr.Key.Start && o.Till == gr.Key.Till)
.OrderBy(d => d.Day).Select(d => d.Day).ToArray()
};
This query provides all the grouped time intervals and days that are included in this time range. But I ran into a problem - I created the second half representing these groups, but it does not work properly. Maybe someone could explain to me the necessary point of view or this basic logic of showing the opening time.
Thanks for the advice...
omoto source
share