Grouping dates by weeks using reduce()
You said to ignore getWeekStart(), but I'm afraid I can't do that.  It appears that the intention of getWeekStart() is to take a date string (in YYYY-MM-DD form) and find the Sunday that starts the week (in YYYY-MM-DD form).  However, depending on the time zone in which the code is executed, it may actually find the Monday, or possibly a Saturday instead.

The problem is that


new Date("YYYY-MM-DD") interprets the date as a UTC timestamp:


  Note: parsing of date strings with the Date constructor (and Date.parse, they are equivalent) is strongly discouraged due to browser differences and inconsistencies. Support for RFC 2822 format strings is by convention only. Support for ISO 8601 formats differs in that date-only strings (e.g. "1970-01-01") are treated as UTC, not local.

date.getDay() returns the day of the week for the specified date according to local time, where 0 represents Sunday.
date.toISOString() works in UTC:


  The toISOString() method returns a string in simplified extended ISO format (ISO 8601), which is always 24 or 27 characters long (YYYY-MM-DDTHH:mm:ss.sssZ or ±YYYYYY-MM-DDTHH:mm:ss.sssZ, respectively). The timezone is always zero UTC offset, as denoted by the suffix "Z".



For the code to be reliably correct, you must work consistently in UTC — in other words, call date.getUTCDay() instead.

Furthermore, I'd rename getWeekStart() to weekStart().  The "get" prefix implies that you are fetching something that already exists.  However, you are actually computing something, so the prefix is superfluous, perhaps even misleading.