Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Wow... wasn't aware of the reduce method. This is almost perfect! Would be possible to also include the time as a property afterwards?. I'll mark your answer as accepted once SO allows me Commented May 7, 2019 at 3:31
  • @user3587624 forgot about that. Also, added anothe approach to get the dynmaic number of time range properties Commented May 7, 2019 at 3:37
  • This works like a charm. I really appreciate it. I will continue learning on the reduce method. Looks very powerful! Commented May 7, 2019 at 3:41
  • I liked your second solution alot. Simple fast and efficient. I thought alot but can't get to your approach. Commented May 7, 2019 at 3:47