It will be much faster if you presort your array before implementing this algorithm. JavaScript getMonth function returns the month number (0 to 11) of a given date. 1. How to GROUP BY Year and Month? share | improve this question | follow | edited Oct 21 '15 at 4:11. The MONTH() function returns the month part for a given date (a number from 1 to 12). MDN will be in maintenance mode, Monday December 14, from 7:00 AM until no later than 5:00 PM Pacific Time (in UTC, Monday December 14, 3:00 PM until Tuesday December 15, 1:00 AM). Next: Write a JavaScript function to get the day of the month, 2 digits with leading zeros. See the next section for a more detailed chart. and after I got the unique days another loop to add the same day to this group as you can see by now you might see why I don't like it and this is why I would love to get some smart help because nothing gets to my head with this. Active 1 month ago. Script by -->