I could iterate through the entire array and checking if the next date is still within the same month and then add it to the sub array if it is. However I was wondering if there was a more succinct or efficient method.

Edit:

Additionally, I need to sort by year and month so, for example, January 15 2014 and January 23 2015 should not be combined.

Here's a method I came up with but it doesn't look terribly efficient: